[R] reading "special" text files

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Aug 24 11:53:52 CEST 2005


Jan Wiener wrote:

> hello,
> 
> assume you have a txt-file (sep="\t" or "") looking as follows that you 
> want to read into a variable:
> 
> 1	1	2			3
> 2	1	2	3		4
> 3	1	5	6	7	8
> 
> the result should look like this (e.g., in a data.frame):
> 
> 1	1	2	3
> 2	1	2	3	4
> 3	1	5	6	7	8
> 
> is there any way to do so?

Yes, with e.g. sep="\t" and sep=" " the number of separators is taken 
into account.
No, with sep="" the separator is *any* white space.


Uwe Ligges


> thanks in advance,
> jan
> 
> ______________________________________________
> 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




More information about the R-help mailing list