Do an 'str' on the vector. Are you sure it is not a 'factor'? Try:
as.numeric(as.character(j1[1])) On 8/24/07, Wolfgang Polasek <[EMAIL PROTECTED]> wrote: > I have a character vector j1 created from dimnames and want it to convert it > to numeric. > Like the first element: > > > j1[1] > f896 > 1 896 > > > as.numeric(j1[1]) > [1] 1990 > > why is it not 896 as it should be? > This is true fr the whole vector. > > Thanks > W.P. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch 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. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? ______________________________________________ R-help@stat.math.ethz.ch 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.