本人是枚编程小白,刚入门学习R语言,不知道以下语句哪里出错,望大佬指点
> D3.2=read.table("clipboard",header=T)> attach(D3.2)The following objects are masked _by_ .GlobalEnv: x1, x2> plot(x1,x2)> text(x1,x2,H,adj=-0.5)> text(x1,x2,H,adj=-0.8)> library(MASS)> ld=lda(H~x1+x2)Error in model.frame.default(formula = H ~ x1 + x2) : 变数的长度不一样('x1')数据在下面
x1 | x2 | H |
74 | 200 | 1 |
100 | 144 | 1 |
110 | 150 | 1 |
70 | 274 | 1 |
96 | 212 | 1 |
80 | 158 | 1 |
80 | 172 | 1 |
100 | 140 | 1 |
100 | 230 | 1 |
100 | 220 | 1 |
90 | 239 | 1 |
110 | 155 | 1 |
100 | 155 | 1 |
96 | 140 | 1 |
100 | 230 | 1 |
80 | 80 | 2 |
94 | 172 | 2 |
100 | 118 | 2 |
70 | 152 | 2 |
80 | 172 | 2 |
80 | 190 | 2 |
70 | 142 | 2 |
80 | 107 | 2 |
80 | 124 | 2 |
80 | 194 | 2 |
78 | 152 | 2 |
70 | 190 | 2 |
80 | 104 | 2 |
80 | 94 | 2 |
84 | 132 | 2 |
70 | 140 | 2 |