Re: [R] How to convert Charagter variables into numeric

2009-02-06 Thread Karina Knaus
You might want to try as.numeric(X), if you want to convert a factor then you could use as.numeric(as.character(X)), where X is a "variable". Karina On Thu, 5 Feb 2009 22:50:38, wrote: > I am importing a dataset in R where some of the variable are numerical and > some of them are character

[R] Collapsing panel data

2009-02-03 Thread Karina Knaus
Dear R-helpers, I've been thinking about this for some time, maybe someone can help. I have a fairly large dataset with thousands of firms, call the a, b, c, etc.. such as [,1] [,2] [1,] "A"0.5 [2,] "" 0.2 [3,] "" 0.3 [4,] "B"0.1 [5,] "" 0.9 [6,] "C"0.4 Or to pu