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

John Kane jrkrideau at yahoo.ca
Mon May 21 00:26:00 CEST 2007


Are you sure that there are tabs?  

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

Otherwise try read.delimited.  


--- Yong Wang <wangyong1 at gmail.com> wrote:

> 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.
>



More information about the R-help mailing list