Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Bert Gunter
I would suggest that unlist(lapply(... should always be preferable to sapply(lapply... if you want to convert data in a data frame to a vector. I can't see any reason to run the same loop twice. But check timings -- maybe I'm overly sensitive to unimportant aesthetics. Cheers, Bert Bert Gunter Ge

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread arun
Hi, Try: min(sapply(lapply(a,as.character),as.numeric))  #[1] 2.2194 A.K. On Wednesday, April 9, 2014 2:27 AM, Sachinthaka Abeywardana wrote: a is ofcourse a subset of data.frame, a ROW of the original table specifically. > str(a) 'data.frame': 1 obs. of  4 variables: $ GHP: Factor w/ 51 le

Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Frede Aakmann Tøgersen
ttp://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender. > -Original Message- > From: Sachinthaka Abeywar

Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Sachinthaka Abeywardana
a is ofcourse a subset of data.frame, a ROW of the original table specifically. > str(a) 'data.frame': 1 obs. of 4 variables: $ GHP: Factor w/ 51 levels "0.0944","0.1446",..: 33 $ GP : Factor w/ 51 levels "0.1755","0.3582",..: 29 $ T : num 2.9 $ Tn : num 3.3 > dput(a) structure(list(GHP = st

Re: [R] Not able to convert data.frame to numeric properly

2014-04-08 Thread Frede Aakmann Tøgersen
We can't say because we don't know how a was created. Please email the output from str(a) and dput(a) Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 fr...@vest