Re: [R] Why a multi column, tab delimited file has only one column after reading in with read.table specification sep="\t"

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Sun, 20 May 2007 18:26:00 -0400 (EDT)


Are you sure that there are tabs?

 try sep=""
?read.table seems to say that this should work

Otherwise try read.delimited.

> Dear all:
> I have a tab delimited file as following
>
> AGE WEIGHT PROTEIN ........
> 6 20 3 ........
> 8 39 4 ........
>
> I tried to read it as following:
>
> data <- read.table(file,sep="\t",header=T);
>
> but there is only column for the data after reading
> in,:
>
> dim(data);
> [1] 200 1
>
> the column name is
> "AGE...WEIGHT...........PROTEIN...."
>
>
> Any quick suggestion will be appreciated.
>
> Best Regards
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch 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.
>



R-help_at_stat.math.ethz.ch 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. Received on Sun 20 May 2007 - 22:32:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 20 May 2007 - 23:31:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.