0
我正在使用VIM库来尝试查看我缺少的数据的模式。从我的原始数据集我做了一个子集如下:VIM绘图函数
newdata<- df[c(11,17:45)] #This makes a new dataframe with columns 11 and 17 through 45 (to get the number of column type (names(dataframe)))
newdata1<-newdata[which(df$variable1=='1' |
df$variable1=='2'),] #This makes a new dataframe of df including only variable 1 = 1 and variable 1 = 2
library(VIM)
## for missing values
miss <- aggr(newdata1)
newdata1
attach(newdata1)
plot(newdata1, sortVars = FALSE,
sortCombs = TRUE, axes = TRUE, combined = FALSE, labels= TRUE)
我无法用我的输出,我没有看到在x轴上的变量。
我希望能够看到丢失的变量的名称。
我的数据帧是这样的:
Result question1 question2 question3 question4 question5
1 1 1 1 1 1
1 2 1 1 2 4
2 1 1 3 1 2
1 1 2 1 3 1
2 NA 1 2 2 1
1 1 1 NA 2 2
1 NA NA 1 3 1
1 1 4 1 3 1
2 2 NA NA 3 2