R qqplot论证" y"缺少错误

时间:2015-02-26 05:19:28

标签: r plot quantile

我对R比较陌生,我正在努力处理与qqplot相关的错误消息。一些样本数据位于底部。我试图在某些方位角数据上做qqplot,就像指南针方向一样。我在这里和?qqplot R文档一起环顾四周,但我没有看到我能理解的解决方案。我不理解函数的语法或数据应该是的格式,或者可能两者都有。我首先尝试将数据加载为单列值,即只是“方位角”列。

azimuth <- read.csv(file.choose(), header=TRUE)
qqplot(azimuth$Azimuth)

返回以下错误,

Error in sort(y) : argument "y" is missing, with no default

然后我尝试将相应的倾角与方位角数据一起包含并收到相同的误差。我也试过了,

qqnorm(azimuth)

但是这返回了以下错误,

Error in xy.coords(x, y, xlabel, ylabel, log) : 
'x' and 'y' lengths differ

数据帧“方位角”:

    Azimuth        Altitude
23.33211466    -6.561729793
31.51267873     4.801537153
29.04577711      5.24504954
23.63450905     14.03342708
29.12535459     7.224141678
20.76972007     47.95686329
54.89253987     4.837417689
56.57958227     13.12587996
13.09845182    -7.417776178
26.45155154     31.83546988
29.15718557     25.47767069
28.09084746     14.61603384
28.93436865    -1.641785416
28.77521371     17.30536039
29.58690392    -2.202076058
0.779859221     12.92044019
 27.1359178     12.20305106
23.57084707     11.97925859
28.99803063     3.931326877

dput()版本:

azimuth <- 
structure(list(Azimuth = c(23.33211466, 31.51267873, 29.04577711, 
23.63450905, 29.12535459, 20.76972007, 54.89253987, 56.57958227, 
13.09845182, 26.45155154, 29.15718557, 28.09084746, 28.93436865, 
28.77521371, 29.58690392, 0.779859221, 27.1359178, 23.57084707, 
28.99803063), Altitude = c(-6.561729793, 4.801537153, 5.24504954, 
14.03342708, 7.224141678, 47.95686329, 4.837417689, 13.12587996, 
-7.417776178, 31.83546988, 25.47767069, 14.61603384, -1.641785416, 
17.30536039, -2.202076058, 12.92044019, 12.20305106, 11.97925859, 
3.931326877)), .Names = c("Azimuth", "Altitude"), class = "data.frame", row.names = c(NA, -19L))

3 个答案:

答案 0 :(得分:2)

也许你想创建图表。

你有没有尝试过?

qqnorm(azimuth$Azimuth);qqline(azimuth$Azimuth)

答案 1 :(得分:1)

似乎qqplot函数有两个输入参数xy,如下所示:

qqplot(x, y, plot.it = TRUE, xlab = "your x-axis label", ylab="your y-axis label", ...)

当你按照上面的说法打电话时,你只给了一个向量,因此R抱怨y参数丢失了。检查您输入的数据集,看看您是否可以找到xyqqplot的通话所应有的内容。

答案 2 :(得分:1)

尝试:

qqPlot

以大写字母P