[R] read.table

2007-09-06 Thread Ingo Holz
Hi, I want to read a ascii-file using the function read.table. With 'skip' and 'nrows' I can select the rows to read from this file. Is there a way to select columns (in the selected rows)? Thanks, Ingo __ R-help@stat.math.ethz.ch mailing list

Re: [R] read.table

2007-09-06 Thread Peter Dalgaard
Ingo Holz wrote: Hi, I want to read a ascii-file using the function read.table. With 'skip' and 'nrows' I can select the rows to read from this file. Is there a way to select columns (in the selected rows)? Yes, use the colClasses argument. (I won't rewrite the help page here; I

[R] read.table opening a website incl Password

2007-05-16 Thread Roland Rau
Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do

Re: [R] read.table opening a website incl Password

2007-05-16 Thread Chuck Cleland
Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password

Re: [R] read.table opening a website incl Password

2007-05-16 Thread Prof Brian Ripley
On Wed, 16 May 2007, Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a

Re: [R] read.table opening a website incl Password

2007-05-16 Thread Bos, Roger
Cc: r-help@stat.math.ethz.ch Subject: Re: [R] read.table opening a website incl Password Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR

Re: [R] read.table opening a website incl Password

2007-05-16 Thread Roland Rau
Dear all, so far I tried various things but I did not really succeed: - starting R with --internet2 - using url() - using read.table(http://myusr:[EMAIL PROTECTED]/adir/afile.txt) I just have an idea what the problem could be for me: The username is actually an email address. So the

[R] read.table

2007-04-24 Thread elyakhlifi mustapha
sorry, I don't undersatnd what happens Annee_O;Id_Essai;Id_Rep;Id_Geno;Id_Cult;Lib_Geno;St_Cult;Id_Par;X_Par;Y_Par;Id_Cara;Surf_O;Val_O;Ori_O;Stade_O;Date_O;Id_Bloc;Id_TrT1 2004;1006003;1;55094;1012988;XF 338/1;;1;1;1;137;;9.4;P;;09/09/2004;1;0 2004;1006003;1;55094;1012988;XF

Re: [R] read.table

2007-04-24 Thread Peter Dalgaard
elyakhlifi mustapha wrote: sorry, I don't undersatnd what happens Annee_O;Id_Essai;Id_Rep;Id_Geno;Id_Cult;Lib_Geno;St_Cult;Id_Par;X_Par;Y_Par;Id_Cara;Surf_O;Val_O;Ori_O;Stade_O;Date_O;Id_Bloc;Id_TrT1 2004;1006003;1;55094;1012988;XF 338/1;;1;1;1;137;;9.4;P;;09/09/2004;1;0

Re: [R] read.table with more than one sep

2007-04-19 Thread Gabor Grothendieck
Try this: # test data Input - 4547;1970.01.01 00:00-1970.01.01 01:00; noData 4547;1970.01.01 00:00-1970.01.01 01:00; noData # replace next line with Lines - readLines(myfile.dat) Lines - readLines(textConnection(Input)) Lines - gsub([;-], , Lines) read.table(textConnection(Lines)) On

Re: [R] read.table for a subset of data

2007-03-12 Thread Thaden, John J
: Sun, 11 Mar 2007 21:33:04 -0500 From: jim holtman [EMAIL PROTECTED] Subject: Re: [R] read.table for a subset of data To: Wensui Liu [EMAIL PROTECTED] Cc: r-help r-help@stat.math.ethz.ch Message-ID: [EMAIL PROTECTED] Content-Type: text/plain If you know what 10 rows to read, then you can 'skip

Re: [R] read.table for a subset of data

2007-03-12 Thread jim holtman
limit on a variable's size. Version 4 removes this limitation; I'm hopeful some day that an R package will be an interface to the NetCDF version 4 library. John Thaden Message: 22 Date: Sun, 11 Mar 2007 21:33:04 -0500 From: jim holtman [EMAIL PROTECTED] Subject: Re: [R] read.table

[R] read.table for a subset of data

2007-03-11 Thread gnv shqp
Hi R-experts, I have data from four conditions of an experiment. I tried to create four subsets of the data with read.table, for example, read.table(Experiment.csv,subset=(condition==1)) . I found a similar post in the archive, but the answer to that post was no. Any new ideas about reading

Re: [R] read.table for a subset of data

2007-03-11 Thread Wensui Liu
as far as I've know, I don't think you can do so with read.table. But I am also thinking about RODBC and wondering if you could assign a DSN to your .csv file and then use sql to fetch the subset. On 3/11/07, gnv shqp [EMAIL PROTECTED] wrote: Hi R-experts, I have data from four conditions of

Re: [R] read.table for a subset of data

2007-03-11 Thread jim holtman
Why cann't you read in the whole data set and then create the subsets? This is easily done with 'split'. If the data is too large, then consider a data base. On 3/11/07, gnv shqp [EMAIL PROTECTED] wrote: Hi R-experts, I have data from four conditions of an experiment. I tried to create

Re: [R] read.table for a subset of data

2007-03-11 Thread Wensui Liu
Jim, Glad to see your reply. Refering to your email, what if I just want to read 10 rows from a csv table with 10 rows? Do you think it a waste of resource to read the whole table in? Anything thought? wensui On 3/11/07, jim holtman [EMAIL PROTECTED] wrote: Why cann't you read in the

Re: [R] read.table for a subset of data

2007-03-11 Thread jim holtman
If you know what 10 rows to read, then you can 'skip' to them, but it the system still has to read each line at a time. I have a 200,000 line csv file of numerics that takes me 4 seconds to read in with 'read.csv' using 'colClasses', so I would guess your 100K line file would take half of that.

[R] read.table

2006-10-19 Thread Weiwei Shi
hi, how could I let the colname be the numbers instead of X plus numbers when I use read.table. Or there is an alternative way? thanks -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. Did you always know? No, I did not. But I believed... ---Matrix III

Re: [R] read.table

2006-10-19 Thread Marc Schwartz
On Thu, 2006-10-19 at 16:10 -0400, Weiwei Shi wrote: hi, how could I let the colname be the numbers instead of X plus numbers when I use read.table. Or there is an alternative way? thanks Sounds like you have imported the data, perhaps using 'header = TRUE' either without an actual header

Re: [R] read.table

2006-10-19 Thread Weiwei Shi
thanks. i know how to go around it but i feel read.table should have something like that to disable the process of adding X to the header :) On 10/19/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Thu, 2006-10-19 at 16:10 -0400, Weiwei Shi wrote: hi, how could I let the colname be the

Re: [R] read.table

2006-10-19 Thread Marc Schwartz
On Thu, 2006-10-19 at 17:06 -0400, Weiwei Shi wrote: thanks. i know how to go around it but i feel read.table should have something like that to disable the process of adding X to the header :) You could try setting 'check.names = FALSE' to see what you end up with in terms of column names.

Re: [R] read.table() and scientific notation

2006-10-11 Thread mmiller3
January == January Weiner [EMAIL PROTECTED] writes: Dear all, I am having troubles importing values written as scientific notation using read.table(). I'm sure this is a frequent problem, as many people in my lab have this problem as well, so I'm sure that I just have

Re: [R] read.table() and scientific notation

2006-10-11 Thread January Weiner
Note: this is advocacy for education in clear quantitative language and is a border-line off topic rant... The other day I read a paper from a student who used notation like 2e-4 in the text - blech! I sent it back for revisions. You have sent it back for revisions just because the student

[R] read.table() and scientific notation

2006-10-10 Thread January Weiner
Dear all, I am having troubles importing values written as scientific notation using read.table(). I'm sure this is a frequent problem, as many people in my lab have this problem as well, so I'm sure that I just have troubles googling for the right solution. The problem is, that, given a file

Re: [R] read.table() and scientific notation

2006-10-10 Thread Gabor Grothendieck
Your example does not exhibit that behavior when I try it (below). Can you provide a reproducible example following the style shown here: Lines - a 1 2e-4 + b 2 3e-8 DF - read.table(textConnection(Lines)) str(DF) 'data.frame': 2 obs. of 3 variables: $ V1: Factor w/ 2 levels a,b: 1 2 $

Re: [R] read.table() and scientific notation

2006-10-10 Thread Prof Brian Ripley
On FC5 Linux: gannet% cat foo.dat a 1 2e-4 b 2 3e-8 gannet% R ... read.table(foo.dat) V1 V2V3 1 a 1 2e-04 2 b 2 3e-08 sapply(read.table(foo.dat), class) V1V2V3 factor integer numeric so please tell us your environment and give a reproducible example

Re: [R] read.table() and scientific notation

2006-10-10 Thread January Weiner
Oh, thanks, that was hint enough :-) I see it now. I turns that R does not understand e-10 ...which stands for 1e-10 and is produced by some of the bioinformatic applications that I use (notably BLAST). However, R instead of being verbose on that just assumes that the whole column is a string.

Re: [R] read.table() and scientific notation

2006-10-10 Thread Martin C. Martin
I think the colClasses argument to read.table() is what you need. Either that, or explicitly cast columns in the data.frame that's returned by read.table(). That's how you get data types that aren't directly supported by read.table(), like various date formats. - Martin January Weiner wrote:

Re: [R] read.table() and scientific notation

2006-10-10 Thread Prof Brian Ripley
On Tue, 10 Oct 2006, January Weiner wrote: Oh, thanks, that was hint enough :-) I see it now. I turns that R does not understand e-10 ...which stands for 1e-10 and is produced by some of the bioinformatic applications that I use (notably BLAST). And that is not standard C notation.

Re: [R] read.table() and scientific notation

2006-10-10 Thread Alex Brown
A cheeky solution by subverting the coerce mechanism and read.table: # install a coerce function which can fix the e+10 syntax for an imaginary class myDouble: setAs(character, myDouble, function(from)as.double(sub('^(-?) e','\\11e',from))) Warning message: in the method signature for

[R] read.table() features {was difficult data ..}

2006-07-04 Thread Martin Maechler
Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Mon, 3 Jul 2006 16:58:14 -0400 writes: Gabor Try this: Gabor # test data Gabor # read in header separately so R does not make column names unique Gabor Lines - AAA BBB CCC DDD AAA BBB Gabor 0 2 1 2 0

[R] read.table with data in specific formats

2006-05-18 Thread YIHSU CHEN
Dear R Users Does anyone know how to read a text with a specific format? I know that has to do with two functions: read.table and sprintf but not sure how to put them together. Say that I have a text file called data.txt, and I would to read it according with %.14f %.10f %2.5f, which

Re: [R] read.table with data in specific formats

2006-05-18 Thread Xiao Liu
read.table segments rows by separators, not by format of entry. Suppose your data.txt is like: 1.00 2.01 3.003 4.10 5.22 6.333 7.22 8.88 9.99 Then read.table(data.txt, sep = ) Best Regards XiaoQuoting YIHSU CHEN [EMAIL PROTECTED]: Dear R Users Does anyone know how to read a text with a

[R] read.table (Error in file(file, r) : unable to open connection)

2006-05-08 Thread David.Lowery
G’day, I am trying to read in a table and am getting an error message stating that R is unable to open a connection to the file. ➢ Avonvegen- read.table(Y:\Study Sites\Avon\nonspatial\datafiles\archive\Avon_VegEnh.dat , sep=,, na.string=-, header=TRUE) Error in file(file, r) : unable to

Re: [R] read.table (Error in file(file, r) : unable to open connection)

2006-05-08 Thread Gabor Grothendieck
See 2.16 of the R Windows FAQ. On 5/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day, I am trying to read in a table and am getting an error message stating that R is unable to open a connection to the file. ➢ Avonvegen- read.table(Y:\Study

Re: [R] read.table (Error in file(file, r) : unable to open connection)

2006-05-08 Thread ronggui
I guess you use R under windows,then use \\ instead of \. or use file.choose() to choose the file directly. 2006/5/9, [EMAIL PROTECTED] [EMAIL PROTECTED]: G'day, I am trying to read in a table and am getting an error message stating that R is unable to open a connection to the file. ➢

[R] Read.table

2006-03-08 Thread Matias Mayor Fernandez
Hi, I have some column vector in txt or xls and I need to load into R as numeric vector. I use the read.table (X=read.table(123.txt”) command but the program say that “X is not a numeric vector” Where is the problem? Matías University of Oviedo, Spain

Re: [R] Read.table

2006-03-08 Thread Uwe Ligges
Matias Mayor Fernandez wrote: Hi, I have some column vector in txt or xls and I need to load into R as numeric vector. I use the read.table (X=read.table(123.txt”) command but the program say that “X is not a numeric vector” No, I think you got: Error: syntax error in

Re: [R] Read.table

2006-03-08 Thread Liaw, Andy
From: Uwe Ligges Matias Mayor Fernandez wrote: Hi, I have some column vector in txt or xls and I need to load into R as numeric vector. I use the read.table (X=read.table(123.txt) command but the program say that X is not a numeric vector No, I think

Re: [R] Read.table

2006-03-08 Thread Sean Davis
On 3/8/06 8:31 AM, Liaw, Andy [EMAIL PROTECTED] wrote: From: Uwe Ligges Matias Mayor Fernandez wrote: Hi, I have some column vector in txt or xls and I need to load into R as numeric vector. I use the read.table (X=read.table(123.txt) command but the program say

[R] read.table missing values

2006-02-22 Thread I.Szentirmai
Dear R users, I'm trying to read data from a tab-delimited text file to R, but I have problems with missing values. R gives this kind of error messages: line 1 did not have 9 elements. Could someone tell me how I can deal with missing values in this case? Thanks a lot in advance, Istvan

Re: [R] read.table missing values

2006-02-22 Thread Sean Davis
Does using read.delim instead of read.table fix your problem? Sean On 2/22/06 7:40 AM, I.Szentirmai [EMAIL PROTECTED] wrote: Dear R users, I'm trying to read data from a tab-delimited text file to R, but I have problems with missing values. R gives this kind of error messages: line 1 did

Re: [R] read.table missing values

2006-02-22 Thread I.Szentirmai
might be, but I have already found another solution: reat.table(file,sep=\t) Thanks, Istvan On Wed, 22 Feb 2006 07:54:49 -0500 Sean Davis [EMAIL PROTECTED] wrote: Does using read.delim instead of read.table fix your problem? Sean On 2/22/06 7:40 AM, I.Szentirmai [EMAIL PROTECTED]

Re: [R] read.table missing values

2006-02-22 Thread MMcIntosh
off? The fill option worked in my case. Use the option with care and double check the dataset. HTH Matthew McIntosh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of I.Szentirmai Sent: Wednesday, February 22, 2006 7:04 AM To: r-help Subject: Re: [R

Re: [R] read.table

2006-02-14 Thread Kjetil Brinchmann Halvorsen
Diethelm Wuertz wrote: Thanks a lot that works fine! Next problem, if I would have my own package, and the file test.csv would be located in the data directory How to use the function data to get data(test) Also put in the data subdirectory the file test.R with the commands to read

[R] read.table

2006-02-14 Thread Max Kauer
Hi it appears to me that read.table is very slow for reading large data files (mine are 200,000 rows). Is there a better way? Thanks! Max -- Maximilian O. Kauer, Ph.D. Department of Genetics, White lab 333 Cedar St, NSB 386 PO Box 208005 New Haven, CT 06510

Re: [R] read.table

2006-02-14 Thread roger bos
?scan is much faser. Also, read.table has a colClasses optional argument which can be used to speed up the reading of large files significantly. read.table has a pretty good help section well worth reading. read.table(file, header = FALSE, sep = , quote = \', dec = .,

[R] read.table

2006-02-13 Thread Diethelm Wuertz
I have a file named test.csv with the following 3 lines: %y-%m-%d;VALUE 1999-01-01;100 2000-12-31;999 read.table(test.csv, header = TRUE, sep = ;) delivers: X.y..m..d VALUE 1 1999-01-01 100 2 2000-12-31 999 I would like to see the following ... %y-%m-%d VALUE 1 1999-01-01

Re: [R] read.table

2006-02-13 Thread jim holtman
?read.table The documentation has the parameter 'check.names'. On 2/13/06, Diethelm Wuertz [EMAIL PROTECTED] wrote: I have a file named test.csv with the following 3 lines: %y-%m-%d;VALUE 1999-01-01;100 2000-12-31;999 read.table(test.csv, header = TRUE, sep = ;) delivers:

Re: [R] read.table

2006-02-13 Thread Gabor Grothendieck
You can do it manually by reading in the headers separately: headers - read.table(test, header = FALSE, nrow = 1, sep = ;, as.is = TRUE) read.table(test, header = FALSE, skip = 1, sep = ;, col.names = headers) On 2/13/06, Diethelm Wuertz [EMAIL PROTECTED] wrote: I have a file named test.csv

Re: [R] read.table

2006-02-13 Thread Diethelm Wuertz
Thanks a lot that works fine! Next problem, if I would have my own package, and the file test.csv would be located in the data directory How to use the function data to get data(test) resulting in: test %y-%m-%d VALUE 1 1999-01-01 100 2 2000-12-31 999 Again Thanks in advance

Re: [R] read.table

2006-02-13 Thread David Scott
On Tue, 14 Feb 2006, Diethelm Wuertz wrote: Thanks a lot that works fine! Next problem, if I would have my own package, and the file test.csv would be located in the data directory How to use the function data to get data(test) resulting in: test %y-%m-%d VALUE 1 1999-01-01

[R] read.table problem

2006-01-25 Thread Andrej Kastrin
Dear R useRs, I have big (23000 rows), vertical bar delimited file: e.g. A1|Text a,Text b, Text c|345 A2|Text bla|456 ... .. . Try using A - read.table('filename.txt', header=FALSE,sep='\|') process stop at line 11975 with warning message: number of items read is not a multiple of

Re: [R] read.table problem

2006-01-25 Thread Peter Dalgaard
Andrej Kastrin [EMAIL PROTECTED] writes: Dear R useRs, I have big (23000 rows), vertical bar delimited file: e.g. A1|Text a,Text b, Text c|345 A2|Text bla|456 ... .. . Try using A - read.table('filename.txt', header=FALSE,sep='\|') process stop at line 11975 with

Re: [R] read.table problem

2006-01-25 Thread Philippe Grosjean
Hello, Well... the error message is explicit enough: number of items read is not a multiple of the number of columns means that you do not have the right number of items around line 11975 (not the same number as in the 11974 previous lines)! This is an error in you file. Best, Philippe

Re: [R] read.table problem

2006-01-25 Thread bogdan romocea
:[EMAIL PROTECTED] On Behalf Of Andrej Kastrin Sent: Wednesday, January 25, 2006 3:08 AM To: r-help Subject: [R] read.table problem Dear R useRs, I have big (23000 rows), vertical bar delimited file: e.g. A1|Text a,Text b, Text c|345 A2|Text bla|456 ... .. . Try using

[R] read.table error

2005-12-07 Thread Eric C. Jennings
Hey, Once again I ask for some quick help. Here is some code: ovendata- read.table(ovens.dat,header=TRUE) attach(ovendata) print(ovendata) Here is the .dat file: DOne Two Three FourFiveSeven Eight 1130254 252 375 384 252 375 876 127 250

[R] read.table without sep

2005-11-25 Thread Vasundhara Akkineni
Hello all, I have a data file table.txt which i have attached. I am trying to pass the columns as arguments to a function totnorm where i am displaying a total normalization plot. The function is given below:

Re: [R] read.table without sep

2005-11-25 Thread P Ehlers
Vasu, You have a lot of problems here. 1. How was your file generated? Excel? You have trailing tabs on all but row 1 which is why your read.table call with sep=\t gives you columns that don't seem to agree with what you expect. See the argument row.names in ?read.table. 2. It's never a good

[R] read.table error with R 2.2.0

2005-11-09 Thread Florence Combes
Dear all, I just upgraded version of R to R 2.2.0, and I have a problem with a script that did not happen with my previous version. Here is the error : - param-read.table(file=param.dat,sep =\t,header=TRUE,fill=TRUE, na.strings=NA) Erreur dans

Re: [R] read.table error with R 2.2.0

2005-11-09 Thread Duncan Murdoch
On 11/9/2005 10:07 AM, Florence Combes wrote: Dear all, I just upgraded version of R to R 2.2.0, and I have a problem with a script that did not happen with my previous version. Here is the error : - param-read.table(file=param.dat,sep

Re: [R] read.table error with R 2.2.0

2005-11-09 Thread Florence Combes
Thanks a lot for your answer. In fact I found the solution, it's seems strange to me so I put it here if it could bu useful for other people ... I have the same as you getAnywhere(read.table)$where [1] package:base namespace:base getAnywhere(read.table.default)$where character(0) when I run it

Re: [R] read.table error with R 2.2.0

2005-11-09 Thread Peter Dalgaard
Florence Combes [EMAIL PROTECTED] writes: Dear all, I just upgraded version of R to R 2.2.0, and I have a problem with a script that did not happen with my previous version. Here is the error : - param-read.table(file=param.dat,sep

Re: [R] read.table error with R 2.2.0

2005-11-09 Thread Henrik Bengtsson
Florence Combes wrote: Thanks a lot for your answer. In fact I found the solution, it's seems strange to me so I put it here if it could bu useful for other people ... I have the same as you getAnywhere(read.table)$where [1] package:base namespace:base

[R] read.table

2005-07-13 Thread Weiwei Shi
Hi, I have a question on read.table. I have a dataset with 273,000 lines and 195 columns. I used the read.table to load the data into R: trn-read.table('train1.dat', header=F, sep='|', na.strings='.') I found it takes forever. then I run 1/10 of the data (test) using read.table again. And this

Re: [R] read.table

2005-07-13 Thread Weiwei Shi
add: I used trn-matrix(scan('train1.dat', sep='|', na.string='.'), nrow=273529, ncol=195) it is done. so it seems that I just have no patience to wait for half an hour :) but i still have that question: is there a way to track the process if it takes too long. Could we stop in the middle to

Re: [R] read.table

2005-07-13 Thread Gabor Grothendieck
You could use the nlines= argument to scan to read in a portion at a time. On 7/13/05, Weiwei Shi [EMAIL PROTECTED] wrote: add: I used trn-matrix(scan('train1.dat', sep='|', na.string='.'), nrow=273529, ncol=195) it is done. so it seems that I just have no patience to wait for half

Re: [R] read.table

2005-07-13 Thread Gabor Grothendieck
[I had some email problems and am sending this again. Sorry if you get it twice.] You could use the nlines= argument to scan to read in a portion at a time. On 7/13/05, Weiwei Shi [EMAIL PROTECTED] wrote: add: I used trn-matrix(scan('train1.dat', sep='|', na.string='.'),

Re: [R] read.table

2005-07-13 Thread Weiwei Shi
that sort of works for my purpose. btw, is there a bettter way to get data.frame by passing around matrix(). Since I could not find data.frame() with nrow or ncol arguments. so i have to use matrix first and then as.data.frame to convert it. is there any other (better) way? weiwei On 7/13/05,

Re: [R] read.table

2005-07-13 Thread Gabor Grothendieck
Maybe you don't really need a data frame in the first place? You were concerned with speed and matrices tend to have higher performance than data frames. On 7/13/05, Weiwei Shi [EMAIL PROTECTED] wrote: that sort of works for my purpose. btw, is there a bettter way to get data.frame by

Re: [R] read.table

2005-07-13 Thread Weiwei Shi
there is another problem since last time i forgot byrow :( trn-matrix(scan('train1.dat', sep='|', na.string='.'), nrow=273529, ncol=195, byrow=T) Read 53338155 items Error: cannot allocate vector of size 416704 Kb please help with this 'simple' reading task. weiwei On 7/13/05, Weiwei Shi

Re: [R] read.table

2005-07-13 Thread Gabor Grothendieck
Try reading it into and transposing the matrix afterwards. Don't know if that would work but its worth a try. Actually if you are having problems read it into a vector, check that its of the required size, just in case, and then turn it into a matrix and transpose it. On 7/13/05, Weiwei Shi

Re: [R] read.table

2005-07-13 Thread Weiwei Shi
i think what you meant is trn-matrix(scan('train1.dat', sep='|', na.string='.'), nrow=195, ncol=273529) and then transpose it. However: Error: cannot allocate vector of size 512000 Kb the answer is no :( I think i am going to write my own function to split the result from scan but not

Re: [R] read.table

2005-07-13 Thread Weiwei Shi
Sorry for last post. I don't know why i got the error message last time. but if i did in the following way: t-scan('train1.dat', sep='|', na.string='.') t2-matrix(t, nrow=195, ncol=273529) t3-t(t2) t4-as.data.frame(t3) now I got what i needed. Thanks a lot for Gabor's prompt help. weiwei On

[R] read.table with header and text data

2005-04-06 Thread Laura Holt
Hi R! I am reading in a text file which has one column of alpha data and 5 columns of numeric data. There is a header row. I would like the alpha data column to just be character rather than factor. Is there a way to do this, please? I'm thinking that it might be I() but can't figure out

Re: [R] read.table with header and text data

2005-04-06 Thread Rich FitzJohn
See ?read.table, especially the argument as.is. Cheers, Rich On Apr 7, 2005 9:55 AM, Laura Holt [EMAIL PROTECTED] wrote: Hi R! I am reading in a text file which has one column of alpha data and 5 columns of numeric data. There is a header row. I would like the alpha data column to

[R] read.table

2005-02-26 Thread Tilo Blenk
Maybe argument 'fill' of read.table is the solution. The default value is FALSE in read.table and, therefore, any line not having the same number of fields as the first line (not skipped) will make problems. If set to TRUE, as in read.delim and read.csv, lines with less number of fields get

Re: [R] read.table

2005-02-26 Thread Uwe Ligges
Tilo Blenk wrote: Maybe argument 'fill' of read.table is the solution. The default value is FALSE in read.table and, therefore, any line not having the same number of fields as the first line (not skipped) will make problems. If set to TRUE, as in read.delim and read.csv, lines with less number

[R] read.table

2005-02-26 Thread John Maindonald
@stat.math.ethz.ch Subject: [R] read.table I have a commonly recurring problem and wondered if folks would share tips. I routinely get tab-delimited text files that I need to read in. In very many cases, I get: a - read.table('junk.txt.txt',header=T,skip=10,sep=\t) Error in scan(file = file, what = what

[R] read.table

2005-02-25 Thread Sean Davis
I have a commonly recurring problem and wondered if folks would share tips. I routinely get tab-delimited text files that I need to read in. In very many cases, I get: a - read.table('junk.txt.txt',header=T,skip=10,sep=\t) Error in scan(file = file, what = what, sep = sep, quote = quote, dec

RE: [R] read.table

2005-02-25 Thread Berton Gunter
:[EMAIL PROTECTED] On Behalf Of Sean Davis Sent: Friday, February 25, 2005 12:12 PM To: r-help Subject: [R] read.table I have a commonly recurring problem and wondered if folks would share tips. I routinely get tab-delimited text files that I need to read in. In very many cases, I get

RE: [R] read.table

2005-02-25 Thread Ted Harding
On 25-Feb-05 Sean Davis wrote: I have a commonly recurring problem and wondered if folks would share tips. I routinely get tab-delimited text files that I need to read in. In very many cases, I get: a - read.table('junk.txt.txt',header=T,skip=10,sep=\t) Error in scan(file = file, what

RE: [R] read.table

2005-02-25 Thread Ted Harding
On 25-Feb-05 Ted Harding wrote: On 25-Feb-05 Sean Davis wrote: I have a commonly recurring problem and wondered if folks would share tips. I routinely get tab-delimited text files that I need to read in. In very many cases, I get: a - read.table('junk.txt.txt',header=T,skip=10,sep=\t)

Re: [R] read.table

2005-02-25 Thread Peter Dalgaard
Berton Gunter [EMAIL PROTECTED] writes: ?readLines I'm sure Perl will do nicely, but you can also use readLines and grep() or regexpr() the result in R as you would in Perl to find where the problem lies. ?nchar can also help to find a non-printing character that may be messing you up.

Re: [R] read.table

2005-02-25 Thread Peter Dalgaard
Peter Dalgaard [EMAIL PROTECTED] writes: You might also try read.delim() which has options set specifically to be able to read Excel-generated CSV files. Blah. *TAB-delimited* files of course. read.csv() for the other ones. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_

[R] read.table from a list of filenames

2004-12-28 Thread thomas hills
I am wondering if it is possible to read.table repeatedly from a list of file names into a new list of table names. For example: filenames - list.files() then with a function like rf - function(i) { word??(filename[i]) - read.table(filenames[i]) } I can't seem to find a function like word??

RE: [R] read.table from a list of filenames

2004-12-28 Thread Liaw, Andy
The solution is in section 7.21 of the R FAQ. BTW, `rf' is a built-in R function for generating random numbers from an F distribution, so better use some other name. Andy From: thomas hills I am wondering if it is possible to read.table repeatedly from a list of file names into a new list

Re: [R] read.table from a list of filenames

2004-12-28 Thread Thomas Lumley
On Tue, 28 Dec 2004, thomas hills wrote: I am wondering if it is possible to read.table repeatedly from a list of file names into a new list of table names. For example: filenames - list.files() then with a function like rf - function(i) { word??(filename[i]) - read.table(filenames[i]) }

Re: [R] read.table from a list of filenames

2004-12-28 Thread Peter Dalgaard
thomas hills [EMAIL PROTECTED] writes: I am wondering if it is possible to read.table repeatedly from a list of file names into a new list of table names. For example: filenames - list.files() then with a function like rf - function(i) { word??(filename[i]) -

[R] read.table in MacOSX

2004-10-28 Thread Matthew Forister
I'm running R version 1.9.0 on Mac OS 10.3.5. I have created text files with data that I need to access from R. When I use the read.table command, I get the warning message: cannot open file These text files DO work on a Mac with a previous version of R. I have tried pasting the data into a

Re: [R] Read.Table Reading a Text file

2004-10-08 Thread Petr Pikal
On 7 Oct 2004 at 20:18, Kunal Shetty wrote: Dear R users and Helpers I am beginner with using R and interested in carrying out certain task for my statistical research. I am reading data for a text file, which could contain data in following pattern x y 8 10 1114 16

RE: [R] Read.Table Reading a Text file

2004-10-08 Thread Petr Pikal
is the problem you are trying tosolve? Executive Technical Consultant -- Office of Technology,Convergys [EMAIL PROTECTED] +1 (513)723-2929 KunalShetty [EMAIL PROTECTED] To:[EMAIL PROTECTED] .educc: Sent by: Subject: [R] Read.Table Reading a Textfile [EMAIL PROTECTED

[R] Read.Table Reading a Text file

2004-10-07 Thread Kunal Shetty
Dear R users and Helpers I am beginner with using R and interested in carrying out certain task for my statistical research. I am reading data for a text file, which could contain data in following pattern x y 8 10 11 14 16 16 18 15 6 20 4 4 20 18 As

Re: [R] Read.Table Reading a Text file

2004-10-07 Thread Kunal Shetty
are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929 Kunal Shetty [EMAIL PROTECTED] To: [EMAIL PROTECTED] .edu cc: Sent by: Subject: [R] Read.Table Reading a Text file [EMAIL PROTECTED] ath.ethz.ch 10/07/2004

RE: [R] Read.Table Reading a Text file

2004-10-07 Thread Kunal Shetty
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Kunal Shetty Sent: Thursday, October 07, 2004 18:44 PM To: [EMAIL PROTECTED] Cc: R-help Subject: Re: [R] Read.Table Reading a Text file James Thank you for response. I am working on treatment for missing data for both bivariate

Re: [R] read.table() question

2004-03-10 Thread asemeria
I don't know read.data function, it is a function that you have defined? A.S. Alessandro Semeria Models and Simulations Laboratory Montecatini Environmental Research Center (Edison Group), Via Ciro Menotti 48, 48023 Marina di Ravenna (RA), Italy Tel. +39 544

[R] read.table() question

2004-03-09 Thread Susan Lin
Hi, In the following code, I got an error meesage if an input file is empty, and the program stopped running. Could someone to tell me how to handle this problem. I want the program to keep running. Thanks. for i in [1:3] { file=paste(file, i, .dat) x - read.data(file) x(11)

[R] read.table with spaces

2004-02-20 Thread AGUSTIN PEREZ MARTIN
DeaR useRs: Excuses for my english. I am trying to read a file with my dats and the format is a number, 3 spaces, other number, etc... When I use: a-read.table(file=c:/datos2.dat,sep=) R sais: Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 3 did not

Re: [R] read.table with spaces

2004-02-20 Thread Robert W. Baer, Ph.D.
won't trigger on ANY whitespace. HTH, Rob - Original Message - From: AGUSTIN PEREZ MARTIN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 20, 2004 8:01 AM Subject: [R] read.table with spaces DeaR useRs: Excuses for my english. I am trying to read a file with my dats

[R] read.table(..)..Help?

2003-11-20 Thread forkusam
Hallo, can someone please help me. I have a proplem reading a file with more that one rows. e.g I used the function: p-read.table(file=FILENAME , header=TRUE,sep=;) and later used the data.Frame() function. It functions when the file has only a row of variables. When I insert the second row I

  1   2   >