Dear all,


I have the problem, please, help me. I tried to import the dataset from the SPSS
into the R. It is the panel (survey). The importing of the data show that my
variables are read as afactor in R. But I need the variable "income" as a
numeric one. I tried to use the following command:   

 for(i in
c("AGE99","AGE00","I99PTOT","I00PTOT","I99PTOTN","I00PTOTN","I99PTOTG","I00PTOTG"))
+ {df[[i]]<-as.numeric(df[[i]])}
 
and then I get the error message. 
Error in "[[<-.data.frame"(*tmp*, i, value = as.numeric(df[[i]])) : 
        replacement has 1 rows, data has 6335

What can I do? Could you please help me. I need it for my work.

Dear all,



I have the problem, please, help me. I tried to import the dataset from the SPSS
into the R. It is the panel (survey). The importing of the data show that my
variables are read as afactor in R. But I need the variable "income" as a
numeric one. I tried to use the following command:   

 for(i in
c("AGE99","AGE00","I99PTOT","I00PTOT","I99PTOTN","I00PTOTN","I99PTOTG","I00PTOTG"))
+ {df[[i]]<-as.numeric(df[[i]])}
 
and then I get the error message. 
Error in "[[<-.data.frame"(*tmp*, i, value = as.numeric(df[[i]])) : 
        replacement has 1 rows, data has 6335

What can I do? Could you please help me. I need it for my work.

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to