Re: [R] read.table or read.csv without row index?

2010-05-05 Thread vincent.deluard
YES IT WORKED!!! Many thanks JiHO Vincent Deluard vincent.delu...@trimtabs.com Global Equity Strategist, CFA Charter Award Pending TrimTabs Investment Research 40 Wall Street, 28th Floor New York, NY 100

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread David Winsemius
On May 5, 2010, at 3:49 PM, JiHO wrote: I tried as.matrix but it did not help. as.matrix() won't work because a matrix requires everything in it to be of the same type (number, character, logical etc.). You do not have only numbers in your data.frame, so it will convert everything to characte

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread JiHO
> I tried as.matrix but it did not help. as.matrix() won't work because a matrix requires everything in it to be of the same type (number, character, logical etc.). You do not have only numbers in your data.frame, so it will convert everything to character strings. If you try as.matrix(temp[,-1])

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread vincent.deluard
Hi, I have the same problem as Wong. I have a csv file that contains weather observation (rows) by days (in columns). I open using: > temp = read.csv("Weather.csv", sep=",") and read: X X1.Jan X2.Jan X3.Jan X4.Jan 1 Min 2 3 4 1 2 Max 6

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread jim holtman
You need to convert to a matrix and remove names: > x <- read.table(textConnection("M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 + 1 9 11 14 15 18 20 20 20 20 20 + 2 3 4 8 9 11 12 14 15 15 15 + 3 4 5 8 8 9 9 9 9 9 9 + 4 4 5 7 8 8 8 8 8 8 9"), header=TRUE) > closeAllConnections() > y

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread Sarah Goslee
Really, this depends on what you are trying to do. What's the underlying problem you are solving? You can save a data frame to a file without the names, if that's the real question, but I can't think of any reason to not want names within R. A matrix does not have to have row and column names, but

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread Henrique Dallazuanna
Try this: unname(as.matrix(read.table('your_file.txt'))) On Wed, Apr 22, 2009 at 11:00 AM, tsunhin wong wrote: > Hello all, > > Probably my concepts about the data.frame and matrix and array in R > are not clear, I need some clarification to help me understand them > better. > > >M <- read.tabl

[R] read.table or read.csv without row index?

2009-04-22 Thread tsunhin wong
Hello all, Probably my concepts about the data.frame and matrix and array in R are not clear, I need some clarification to help me understand them better. >M <- read.table("test1.csv",sep=",",row.names=NULL,header=T) gives me: M as M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 1 9 11 14 15 18 20 20 20 20