1
텍스트 파일에있는 기능의 상위 10 개 값만으로 구성된 점 줄무늬를 만들고 싶습니다. 다음 코드는 작동하지만 출력은 160 개의 모든 변수가 포함 된 점선입니다.dotplot의 변수를 제한하는 방법은 무엇입니까?
library(lattice)
table<-"imp_s2.txt"
DT<-read.table(table, header=T)
# output graph to pdf file
pdf("dotplot_s2.pdf")
colnames(DT)
DT$feature <- reorder(DT$feature, DT$IncMSE)
dotplot(feature ~ IncMSE, data = DT,
aspect = 1.5,
xlab = "Variable Importance, Scale 2",
scales = list(cex = .6),
panel = function (x, y) {
panel.abline(h = as.numeric(y), col = "gray", lty = 2)
panel.xyplot(x, as.numeric(y), col = "black", pch = 16)})
dev.off()