我正在尝试从 alr3 包中绘制钞票数据框。我的 pair 函数抛出错误并且在执行时没有给我正确的绘图。有人可以告诉我这里出了什么问题吗?谢谢。
基本上我正在尝试编写代码以从“alr3”包中存在的“钞票”数据框中找出所有假钞。
代码:-
pairs(banknote[,-1],panel=
function(x,y,fake){
xy <- cbind(x,y)
points(xy[fake==0,],pch=15)
points(xy[fake==1,],pch=0)
}, fake=Y)
错误:-
Error in points(xy[fake == 0, ], pch = 15) :
(subscript) logical subscript too long
In addition: Warning messages:
1: In plot.window(...) : "fake" is not a graphical parameter
2: In plot.xy(xy, type, ...) : "fake" is not a graphical parameter
3: In title(...) : "fake" is not a graphical parameter
4: In plot.window(...) : "fake" is not a graphical parameter
5: In plot.xy(xy, type, ...) : "fake" is not a graphical parameter
6: In title(...) : "fake" is not a graphical parameter
7: In axis(side = side, at = at, labels = labels, ...) :
"fake" is not a graphical parameter