[R] Importing files

jim holtman jholtman at gmail.com
Sun Mar 18 22:59:58 CET 2012

You attachment never made it through.  Try sending it as '.txt' file.
If the file is using both tabs and commas on the same line, then you
may have to use 'readLines' to read it in, and then 'strsplit' to
split out the different elements.

On Sun, Mar 18, 2012 at 4:13 PM, Santiago Guallar <sguallar at yahoo.com> wrote:
> Hello,
> I'm trying to import into R files that contain data downloaded from logger devices as files with the following formats:
> .act
> .lig
> .trj
> .trn
> These files are essentially text files but use both tabs and commas as separators.
> I've tried the function scan:
> 1) scan("filename.act", what=character(0)) returns only two columns from the original 5
> 2) scan("copia.act", what=character(0),sep=",") returns three columns but puts the original fifth one in the next row
> Attached a sample file with five fields. How can I get one field per column?
> Thank you for your help
> ______________________________________________
> 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.

Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

More information about the R-help mailing list