Re: [R] convert factor data to numeric

2010-10-18 Thread Gavin Simpson
On Sat, 2010-10-16 at 16:16 -0700, andreas wrote: I had exactly the same problem with trying to import another .csv file. Turns out that I was working on a german computer that instead of using a comma when I saved it as .csv used a semicolon. Just saved it as a normal excel file, put it on a

Re: [R] convert factor data to numeric

2010-10-16 Thread andreas
I had exactly the same problem with trying to import another .csv file. Turns out that I was working on a german computer that instead of using a comma when I saved it as .csv used a semicolon. Just saved it as a normal excel file, put it on a mates computer and saved it as .csv Worked a treat..

Re: [R] convert factor data to numeric

2010-10-15 Thread andreas
cheers mate that worked fine thanks a bunch -- View this message in context: http://r.789695.n4.nabble.com/convert-factor-data-to-numeric-tp1012855p2996495.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] convert factor data to numeric

2010-10-14 Thread andreas
I have yet another novice 'converting factors to numeric problem'. The problem is as described by others: read data (using read.csv) in from excel.csv file and it turns out to be a factor in R. The data in execl only has 4 rows: treat absorb 0 1.8052 0.5 2.07075 1.0

Re: [R] convert factor data to numeric

2010-10-14 Thread jim holtman
If you read the data as posted in your email with read.csv, you probably got this: s1 - read.csv(textConnection(treat absorb + 0 1.8052 + 0.5 2.07075 + 1.0 2.2345)) closeAllConnections() s1 treat...absorb 1 0 1.8052 2 0.5 2.07075 3 1.0 2.2345

Re: [R] convert factor data to numeric

2010-10-14 Thread andreas
cheers for the quick reply. Sorry I am getting a bit confused I have never used the anything else any from of extension on read.csv what I did was: 1. enter the data into excel and save it as comma delimited 2. then used: s1 - read.csv(book1.csv) If i try to run this s1 -

Re: [R] convert factor data to numeric

2010-10-14 Thread Joshua Wiley
On Thu, Oct 14, 2010 at 8:41 PM, andreas andreasse...@web.de wrote: cheers for the quick reply. Sorry I am getting a bit confused I have never used the anything else any from of extension on read.csv what I did was: 1. enter the data into excel and save it as comma delimited 2. then used:

[R] convert factor data to numeric

2010-01-13 Thread Ahmet Temiz
hello could you give me a hint to convert data in factor type to numeric (float) ? regards -- Open WebMail Project (http://openwebmail.org) -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

Re: [R] convert factor data to numeric

2010-01-13 Thread Dimitris Rizopoulos
check the following: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f Best, Dimitris Ahmet Temiz wrote: hello could you give me a hint to convert data in factor type to numeric (float) ? regards -- Open WebMail Project (http://openwebmail.org)

Re: [R] convert factor data to numeric

2010-01-13 Thread S Devriese
On 01/13/2010 10:47 AM, Ahmet Temiz wrote: hello could you give me a hint to convert data in factor type to numeric (float) ? regards -- Open WebMail Project (http://openwebmail.org) you could try as.numeric but without more details it is difficult to see if this will work. How

Re: [R] convert factor data to numeric

2010-01-13 Thread Peter Ehlers
S Devriese wrote: On 01/13/2010 10:47 AM, Ahmet Temiz wrote: hello could you give me a hint to convert data in factor type to numeric (float) ? regards -- Open WebMail Project (http://openwebmail.org) you could try as.numeric but without more details it is difficult to see if this will

Re: [R] convert factor data to numeric

2010-01-13 Thread Nathalie Yauschew-Raguenes
Hello, I find a way to convert data in factor type to numeric : data_numeric - as.numeric(as.character(data_factor)). It's treaky but works. Peter Ehlers a écrit : S Devriese wrote: On 01/13/2010 10:47 AM, Ahmet Temiz wrote: hello could you give me a hint to convert data in factor type to

Re: [R] convert factor data to numeric

2010-01-13 Thread S Devriese
On 01/13/2010 05:41 PM, Peter Ehlers wrote: S Devriese wrote: On 01/13/2010 10:47 AM, Ahmet Temiz wrote: hello could you give me a hint to convert data in factor type to numeric (float) ? regards -- Open WebMail Project (http://openwebmail.org) you could try as.numeric but

Re: [R] convert factor data to numeric

2010-01-13 Thread Rolf Turner
On 14/01/2010, at 6:00 AM, Nathalie Yauschew-Raguenes wrote: Hello, I find a way to convert data in factor type to numeric : data_numeric - as.numeric(as.character(data_factor)). It's treaky but works. Possibly even more ``treaky'' but more efficient is: data_numeric -