There was a very informative thread on this list only a week or so ago (I started it!). If you're reading from a table or a csv file, see the colClasses argument. Otherwise see ?as.numeric.
Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Samuel Bächler Sent: Friday, August 29, 2008 1:09 PM To: [email protected] Subject: Re: [R] I need to change from character to numeric? > I am reading numeric data as below but the problem is the object > ndata1 and nd1 have characters instead of numeric values. I want to > keep it as numeric. Why the type has changed from numeric to > character and how to avoid this problem? help(as.numeric) Your variable rdata1 has probably character-type. s. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

