Re: [R] changing factor to numbers without getting NAs

2016-05-13 Thread ch.elahe via R-help
Thanks Duncan, This type.convert works fine for me and gives me TSTMean with decimal, but I want to add this result as a new column to my df as int or num, how can I do this? Thanks, Elahe On Friday, May 13, 2016 2:15 PM, Duncan Murdoch wrote: On 13/05/2016 7:56

Re: [R] changing factor to numbers without getting NAs

2016-05-13 Thread Marc Schwartz
> On May 13, 2016, at 6:56 AM, ch.elahe via R-help wrote: > > Hi all, > I have a df which a part of this is: > > TSTMax :int 213 228 227 281 > TSTMin :int 149 167 158 176 > TSTMean:Factor w/94 levels "100,2" , "104,3" , ... > I want to change the

Re: [R] changing factor to numbers without getting NAs

2016-05-13 Thread Duncan Murdoch
On 13/05/2016 7:56 AM, ch.elahe via R-help wrote: Hi all, I have a df which a part of this is: TSTMax :int 213 228 227 281 TSTMin :int 149 167 158 176 TSTMean:Factor w/94 levels "100,2" , "104,3" , ... I want to change the TSTMean into numeric but by using

[R] changing factor to numbers without getting NAs

2016-05-13 Thread ch.elahe via R-help
Hi all, I have a df which a part of this is: TSTMax :int 213 228 227 281 TSTMin :int 149 167 158 176 TSTMean:Factor w/94 levels "100,2" , "104,3" , ... I want to change the TSTMean into numeric but by using as.numeric(as.character(df$TSTMean)) I get too many NAs. Is there