Re: [R] / Operator not meaningful for factors

2010-05-04 Thread Don MacQueen
At 3:50 PM -0700 5/3/10, John Kane wrote: I think that you are correct. R has the annoying habit of converting character data to factors when you don't want it to while it is importing data. This is because the in the option stringsAsFactors is set to TRUE for some weird historical reasons.

Re: [R] / Operator not meaningful for factors

2010-05-04 Thread Petr PIKAL
think, but it's not tested read.table(C:/rdata/trees.csv, stringsAsFactors=FALSE) --- On Mon, 5/3/10, vincent.deluard vincent.delu...@trimtabs.com wrote: From: vincent.deluard vincent.delu...@trimtabs.com Subject: Re: [R] / Operator not meaningful for factors To: r

Re: [R] / Operator not meaningful for factors

2010-05-04 Thread Petr PIKAL
Hi Yes, it is also possible. I usually use as.numeric(as.character(some.factor.which can.be.transformed.to.numeric)) Regards Petr Katya Mauff katya.ma...@uct.ac.za napsal dne 04.05.2010 10:42:20: apologies-try something like this: x-rnorm(5) x [1] 0.9128818 1.5615704 -1.2319878

Re: [R] / Operator not meaningful for factors

2010-05-04 Thread John Kane
--- On Tue, 5/4/10, Petr PIKAL petr.pi...@precheza.cz wrote: From: Petr PIKAL petr.pi...@precheza.cz Subject: Re: [R] / Operator not meaningful for factors To: John Kane jrkrid...@yahoo.ca Cc: r-help@r-project.org, vincent.deluard vincent.delu...@trimtabs.com Received: Tuesday, May 4, 2010

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread vincent.deluard
Hi there, This will sound very stupid because I just started using R but I see you had similar problems. I just loaded a very large dataset (2950*6602) from csv into R. The format is ticker=row, date=column. Every time I want to compute basic operations, R returns In Ops.factor: not meaningful

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread David Winsemius
On May 3, 2010, at 6:22 PM, vincent.deluard wrote: Hi there, This will sound very stupid because I just started using R but I see you had similar problems. I just loaded a very large dataset (2950*6602) from csv into R. The format is ticker=row, date=column. Not a particularly

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread John Kane
this should work, I think, but it's not tested read.table(C:/rdata/trees.csv, stringsAsFactors=FALSE) --- On Mon, 5/3/10, vincent.deluard vincent.delu...@trimtabs.com wrote: From: vincent.deluard vincent.delu...@trimtabs.com Subject: Re: [R] / Operator not meaningful for factors To: r-help@r

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread vincent.deluard
Hi David, Thanks for the prompt answer. In this file, I have cut the data to the first 15 columns. Here is the code: t2 - read.csv('Test2.csv', sep=,, header=TRUE) Test2[2,2] [1] 18.72 1994 Levels: 0.24 0.33 0.49 0.53 0.65 0.67 0.72 0.76 0.88 0.9 0.94 ... 98.88 Test2[2,2]+1 [1]

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread vincent.deluard
) --- On Mon, 5/3/10, vincent.deluard [hidden email] wrote: From: vincent.deluard [hidden email] Subject: Re: [R] / Operator not meaningful for factors To: [hidden email] Received: Monday, May 3, 2010, 6:22 PM Hi there, This will sound very stupid because I just started using R but I

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread David Winsemius
in the read.table to FALSE Something like this should work, I think, but it's not tested read.table(C:/rdata/trees.csv, stringsAsFactors=FALSE) --- On Mon, 5/3/10, vincent.deluard [hidden email] wrote: From: vincent.deluard [hidden email] Subject: Re: [R] / Operator not meaningful for factors

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread jim holtman
[hidden email] wrote: From: vincent.deluard [hidden email] Subject: Re: [R] / Operator not meaningful for factors To: [hidden email] Received: Monday, May 3, 2010, 6:22 PM Hi there, This will sound very stupid because I just started using R but I see you had similar problems. I

Re: [R] / Operator not meaningful for factors

2010-05-03 Thread Erik Iverson
The stringAsFactors = False option did not work either. False FALSE in addition Vincent was getting an error since he used stringAsFactors, instead of stringsAsFactors as the argument name. __ R-help@r-project.org mailing list