Re: [R] Convert character Variables to numeric

2015-08-26 Thread Jeff Newmiller
I agree that having a few (5-20 perhaps) rows of the data is essential to give you appropriate help. Be warned that files with extension .CSV (or must others as well) don't make it through the mailing list filters, so be sure to read the Posting Guide and either change the name of the file so

[R] Convert character Variables to numeric

2015-08-26 Thread Arun84441
I have imported the csv file having 398800 obs of 30 variables. There is a variable TOTALFRT which is showing as character in R environment. I am trying to convert it to numeric by using as.numeric function. Wherein function is converting character to numeric but with an error message Warning

Re: [R] Convert character Variables to numeric

2015-08-26 Thread jim holtman
Please provide a sample of the data that you are trying to convert. BTW does it have commas in numeric values, or what else is strange about the data. The error message is very clear in the column of data that you are trying to convert is not numeric. Jim Holtman Data Munger Guru What is the

Re: [R] Convert character Variables to numeric

2015-08-26 Thread MacQueen, Don
In addition to what Jim and Jeff said, I would suggest trying this: tmp - is.na(V) ## then head(Mac$TOTALFRT[tmp]) ## or head( V[tmp] ) This will show you the first few rows of the values which you think should be numeric but are not. Hopefully, you will be able to see why they are not numeric.

Re: [R] Convert character Variables to numeric

2015-08-26 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Newmiller Sent: Wednesday, August 26, 2015 1:52 PM To: jim holtman; Arun84441 Cc: R mailing list Subject: Re: [R] Convert character Variables to numeric I agree that having a few (5-20 perhaps) rows of the data