[R] Variable length datafile import problem

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Tue Feb 15 17:46:06 CET 2011


Can you try to change the extention of your file (make it a .txt or
open it in Excel and save it as a .csv file) - and then read it in?
Dimitri

On Tue, Feb 15, 2011 at 9:12 AM, Ingo Reinhold <ingor at kth.se> wrote:
> Dear all,
>
> I am stuck the reading of a file which has 100s of rows and variable column counts.
>
> The tab-limited data file looks something like:
>
> Some_Text     1    3    123    1534    -119    1010    178
> Some_Taxt     1    3    133    1434    -219    1010    178
> Some_Tsxt     1    3    244    1334    -319    1010    178
> Some_Tfxt     1    3    153    1234    -419    1010    178
> Some_Trxt     1    3    163    1234    -519    1010    178
>
> When I try reading it using:
>
> rawData=read.table("Datafile.dat", fill=FALSE, sep="\t", header=FALSE);
>
> I get something like
>
> Some_Text     1    3    123    1534    -119    1010    178
> Some_Taxt     1    3    133    1434    -219    1010    178
> 1010
> Some_Tsxt     1    3    244    1334    -319    1010    178
> Some_Tfxt     1    3    153    1234    -419    1010    178
> -419
> Some_Trxt     1    3    163    1234    -519    1010    178
>
> I am not sure what this is. It also appear to be quenching some of the columns, which may be the problem. My current maximum is around 250, but this is not determined. When importing it the maximum table size seems to stop at 146.
>
> Has anyone seen this before?
>
> Many thanks,
>
> Ingo
>
>        [[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.
>



-- 
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com



More information about the R-help mailing list