Basically a complement to @GregSnow's answer, from the manual.
All quotes from ?read.csv :
If colClasses is not specified, all columns are read as character columns, and then converted using the type.convert method to a logical, integer, numeric, complex, or (depending on as.is) factor, if necessary. Quotes (by default) are interpreted in all fields, so a column of values โโof type "42" will result in an integer column.
Also:
The number of data columns is determined by searching for the first five lines of input ...
Suggests read.csv looks at the first 5 lines and guesses if there is a numeric / integer column, otherwise it saves it as character (and thus saves the leading 0 ).
If you are still interested in learning more, I suggest you study the code in edit(read.csv) and edit(read.table) , which are long but will describe each step of the function.
Finally, as an aside, it is usually recommended to specify colClasses :
Less memory will be used if colClasses is specified as one of six atomic classes of an atom. This can be especially noticeable when reading a column that takes many different numerical values, since storing each individual value as a character string can take up to 14 times more memory than storing it as an integer.
Although, if you are really concerned about memory usage / speed, you really should use fread from data.table ; even then, by specifying colClasses , acceleration is created.