Why do I get an error of can't make a table of more 2^31 elements in R

前端 未结 5 632
灰色年华
灰色年华 2020-12-10 16:37

Hello I have a dataframe record in R of dimension 8 obs 60 variables , with the missing values replaced by NA and the other values being words.

When I try

5条回答
  •  旧时难觅i
    2020-12-10 17:35

    I also had this issue. What worked for me was by converting each column in the dataframe into a numeric or character using the following lines:

    df$x = as.numeric(as.character(df$x))
    df$y = as.numeric(as.character(df$y))
    df$z= as.numeric(as.character(df$z))
    

    This will remove the factor levels in each of the variables within the dataframe. If you need the factor levels, I would not recommend doing this, but if you just need the raw values this will work well.

提交回复
热议问题