[R] read.table() vs read.delim() any difference??

Jan van der Laan rhelp at eoos.dds.nl
Fri May 4 10:22:31 CEST 2012


read.delim calls read.table so any differences between the two are  
caused by differences in the default values of some of the parameters.  
Take a look at the help file ?read.table

read.table uses white space as separator; read.delim tabs
read.table uses " and ' as quotes; read.delim just "
etc.

Jan


Rameswara Sashi Kiran Challa <schalla at umail.iu.edu> schreef:

> Hi,
>
> I have a tab seperated file with 206 rows and 30 columns.
>
> I read in the file into R using read.table() function. I checked the dim()
> of the data frame created in R, it had only 103 rows (exactly half), 30
> columns. Then I tried reading in the file using read.delim() function and
> this time the dim() showed to be 206 rows, 30 columns as expected.
> Reading the read.table() R-help documentation, I came across count.fields()
> function. On using that on the tab seperated file, I got to learn that the
> header line alone has 30 fields and rest of the rows have 9 fields. I am
> now just wondering why read.delim() function was able to read in the file
> correctly and read.table() wasn't able to read the file completely ?
>
> Could anyone please throw some light on this?
>
> Thanks for your valuable time,
>
> Regards
> Sashi
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list