r - 关于在 R 中绘制椭圆的问题
问题描述
我试图绘制椭圆,但似乎中心的长度有问题..它说中心的长度应该是 2,不知道这是什么意思,因为我尝试了长度(中心)它正好是 2.. 有没有人知道如何解决吗?提前致谢:)
l2<-c(141, 140, 145, 146, 150, 142, 139)
l3<-c(157, 168, 162, 159, 158, 140, 171)
l4<-c(168, 174, 172, 176, 168, 178, 176)
l5<-c(183, 170, 177, 171, 175, 189, 175)
a.mat<-matrix(c(l3-l2,l5-l4), 7, 2)
dbar<-matrix(c(16, 4), 2, 1)
library(ellipse)
n<-7
p<-4
S<-var(a.mat)
plot(ellipse(S,centre=dbar,t=sqrt(((n-1)*p/(n*(n-p)))*qf(0.95,p,n-p))),type="l",xlim=c(-40,60),ylim=c(-40,40),
main="95% Confidence Ellipse for \nSuccessive Yearly Length Increases \nYear3-Year2 and Year5-Year4", xlab = "Year3-Year2",
ylab = "Year5-Year4")
错误显示为:
centre must be a vector of length 2```
Then I tried:
> length(centre)
[1] 2
解决方案
推荐阅读
- python - 如何在已知变量的情况下数值求解多变量联立方程?
- c - C语言:从文件重定向输入时如何知道何时不再有来自标准输入的输入
- javascript - 如何在 onwrite 事件中获取 firebase pushID?
- javascript - 具有两个数字输入的多个滑块
- php - 找不到驱动程序,将php连接到sql server
- dart - dart中的完整路径和相对路径有什么区别
- python - Django Rest Framework 自定义异常处理无法识别参数
- npm - 纱线安装,模块构建失败:错误:找不到预设“es2015”
- python - Robot Framework:如何区分由于常规测试步骤关键字失败而导致的测试用例 FAIL 与验证测试步骤失败
- c# - 如何在将脚本添加到实例化对象时访问脚本的属性,并在代码中设置转换