[R] read.delim

2013-04-02 Thread Shane Carey
Hi, Im reading in a .txt file into R that consists of 5 columns, however, when imported into R, it reads all the data into just one column. Is there a way of telling R to create a dataframe with 5 columns rather than putting all the data into one column? Thanks -- Shane [[alternative

Re: [R] read.delim

2013-04-02 Thread Steve Friedman
You have to tell R what the column delimiter is. See Read.table. On Apr 2, 2013 8:28 AM, Shane Carey careys...@gmail.com wrote: Hi, Im reading in a .txt file into R that consists of 5 columns, however, when imported into R, it reads all the data into just one column. Is there a way of

Re: [R] read.delim()

2010-07-29 Thread Ben Bolker
2010 Subject: Re: [R] read.delim() Harold - If there aren't any true quoted fields in the file, you could pass the quote= option to read.delim(). - Phil Spector Statistical Computing Facility

[R] read.delim()

2010-07-28 Thread Doran, Harold
I am reading in a very large file with names in it and R is truncating the number of rows it reads in. The separator in this file is a pipe '|' and so I use dat - read.delim('pathToMyFile', header= TRUE, sep='|') It turns out that it is reading up to row 61145 and stopping and I think I see

Re: [R] read.delim()

2010-07-28 Thread Phil Spector
Harold - If there aren't any true quoted fields in the file, you could pass the quote= option to read.delim(). - Phil Spector Statistical Computing Facility Department

Re: [R] read.delim()

2010-07-28 Thread Doran, Harold
Thank you, Phil. Unfortunately, there are quotes used properly elsewhere. - Original Message - From: Phil Spector spec...@stat.berkeley.edu To: Doran, Harold Cc: r-help@r-project.org r-help@r-project.org Sent: Wed Jul 28 18:29:32 2010 Subject: Re: [R] read.delim() Harold

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-25 Thread Ping-Hsun Hsieh
if it helps. Thanks! Mike -Original Message- From: Benilton Carvalho [mailto:bcarv...@jhsph.edu] Sent: Wednesday, September 23, 2009 4:56 PM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] read.delim very slow in reading files with lots of columns use the 'colClasses' argument

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-25 Thread Charles C. Berry
will try the scan() and see if it helps. Thanks! Mike -Original Message- From: Benilton Carvalho [mailto:bcarv...@jhsph.edu] Sent: Wednesday, September 23, 2009 4:56 PM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] read.delim very slow in reading files with lots of columns use

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-25 Thread Benilton Carvalho
for reading the matrix. I will try the scan() and see if it helps. Thanks! Mike -Original Message- From: Benilton Carvalho [mailto:bcarv...@jhsph.edu] Sent: Wednesday, September 23, 2009 4:56 PM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] read.delim very slow in reading

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-25 Thread jim holtman
, September 23, 2009 4:56 PM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] read.delim very slow in reading files with lots of columns use the 'colClasses' argument and you can also set 'nrows'. b On Sep 23, 2009, at 8:24 PM, Ping-Hsun Hsieh wrote: Hi, I am trying to read

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-25 Thread Benilton Carvalho
- From: Benilton Carvalho [mailto:bcarv...@jhsph.edu] Sent: Wednesday, September 23, 2009 4:56 PM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] read.delim very slow in reading files with lots of columns use the 'colClasses' argument and you can also set 'nrows'. b On Sep 23, 2009

Re: [R] read.delim very slow in reading files with lots of columns

2009-09-23 Thread Benilton Carvalho
use the 'colClasses' argument and you can also set 'nrows'. b On Sep 23, 2009, at 8:24 PM, Ping-Hsun Hsieh wrote: Hi, I am trying to read a tab-delimited file into R (Ver. 2.8). The machine I am using is 64bit Linux with 16 GB. The file is basically a matrix(~600x70) and as large

Re: [R] read.delim skips first column (why?)

2009-07-15 Thread Paolo Sonego
This should work: junk -read.table(fd0edfab.txt, sep=, header=T, fill=F,quote= ) HIH Paolo Sonego __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] read.delim skips first column (why?)

2009-07-14 Thread Giovanni Marco Dall'Olio
Hi, I have uploaded a copy of the file here: - http://pastebin.com/fd0edfab the file has also been passed throught the unix command tool unexpand, but it doesn't solve the problem. using head=TRUE instead of head=T has also the same effect. the output of print(names) is: print(names(ngly),

Re: [R] read.delim skips first column (why?)

2009-07-14 Thread Petr PIKAL
Hi str(read.table(test.txt, header=T)) 'data.frame': 9 obs. of 12 variables: $ snp : Factor w/ 9 levels rs1113188,rs1113397,..: 9 5 7 8 3 4 6 1 2 $ gene : Factor w/ 1 level TRP2: 1 1 1 1 1 1 1 1 1 $ chromosome : int 3 3 3 3 3 3 3 3 3

Re: [R] read.delim skips first column (why?)

2009-07-14 Thread Gabor Grothendieck
Try count.fields(myfile.txt, sep = \t) read.delim uses sep = \t but there are trailing tabs on some lines. The first line, i.e. with the headers, has three trailing tabs so it thinks that there are 15 columns rather than 12. The 5th line of the file (4th line of data) has 4 trailing tabs so it

[R] read.delim skips first column (why?)

2009-07-13 Thread Giovanni Marco Dall'Olio
Hi people, I have a text file like this one posted: snp_id genechromosome distance_from_gene_center positionpop1pop2pop3pop4pop5pop6pop7 rs2129081 RAPT2 3 -129993 upstream 0.439009 1.169210NA 0.2330200.093042