PostDF <- read.csv("https://raw.githubusercontent.com/thistleknot/Capstone-577/master/output/V7221-greaterEqual-10-filtered.csv", header=TRUE, sep=",")[,-1,drop=FALSE]
x <- PostDF[,-1, drop=FALSE]
y <- data.frame(PostDF[,1, drop=FALSE])[,1]
pcr_model <- glm.pcr(list(y), x, k=ncol(PostDF[,-1]),xnew = NULL)
上面的代码抛出此错误:
pcr_model <-glm.pcr(list(y),x,k = ncol(PostDF [,-1]),xnew = NULL) x%*%vec中的错误:需要数字/复杂矩阵/矢量参数
代码有什么问题?如何解决该错误?