[R] as.numeric : what goes wrong?
jholtman at gmail.com
Fri Aug 24 14:00:59 CEST 2007
Do an 'str' on the vector. Are you sure it is not a 'factor'?
On 8/24/07, Wolfgang Polasek <wolfgang.polasek at gmail.com> wrote:
> I have a character vector j1 created from dimnames and want it to convert it
> to numeric.
> Like the first element:
> > j1
> 1 896
> > as.numeric(j1)
>  1990
> why is it not 896 as it should be?
> This is true fr the whole vector.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help