plsr()
似乎无法使用公式,但它可以手动运行,为什么会这样?
y = plsr(W, data = mydata) # this doesn't work!
Error in formula[[2]] : subscript out of bounds
> W
[1] "GDPperCapita ~ 1 + administ + culture + Euro"
y = plsr(GDPperCapita ~ 1 + administ + culture + Euro, data = mydata) # …but this works!
PS:我试过用noquote()
来操纵变量W,但是这也解决不了...解决方案非常感谢!
非常感谢