On 12/04/2010 01:25 AM, Katharina Noussi wrote:
Hello,
I have a dataframe assigning various scores on around 20 variables to a list of
countries. The scores are rated on a scale of (D, C, B, A) and there are also
some not rated ones (NR) and others are left blank (NA). I now wanted to
transfer t
Katharina -
I think something like this may be helpful:
z = data.frame(matrix(sample(c(LETTERS[1:4],'NR',NA),100,replace=TRUE),20,5))
codes = c(A=100,B=27,C=50,D=25,NR=0)
newz = sapply(z,function(x)codes[x])
- Phil Spector
Hello,
I have a dataframe assigning various scores on around 20 variables to a list of
countries. The scores are rated on a scale of (D, C, B, A) and there are also
some not rated ones (NR) and others are left blank (NA). I now wanted to
transfer the scores into numeric values (such as NR=0, D=
3 matches
Mail list logo