数据集:两个二元不等观测值:
g_d g_a s_d s_a
2 27.75047815 2 27.75047815
2 27.75047815 2 27.75047815
3 27.75047815 2 27.75047815
3 27.75047815 2 27.75047815
3 27.75047815 2 27.75047815
5 27.75047815 2 27.75047815
6 27.75047815 2 27.75047815
8 27.75047815 2 27.75047815
9 27.75047815 2 27.75047815
10 27.75047815 2 27.75047815
3 17.19518769 2 27.75047815
3 13.21767851 2 27.75047815
4 13.21767851 3 27.75047815
4 13.21767851 3 27.75047815
5 13.21767851 3 27.75047815
6 13.21767851 3 27.75047815
6 13.21767851 3 27.75047815
6 13.21767851 3 27.75047815
7 13.21767851 3 27.75047815
8 13.21767851 3 27.75047815
9 13.21767851 3 27.75047815
9 13.21767851 3 27.75047815
11 13.21767851 3 27.75047815
11 13.21767851
14 13.21767851
14 13.21767851
14 13.21767851
15 13.21767851
16 13.21767851
17 13.21767851
24 13.21767851
2 30.90877312
2 30.90877312
2 30.90877312
2 30.90877312
2 30.90877312
3 30.90877312
3 30.90877312
3 30.90877312
我正在尝试使用以下命令在同一绘图窗口中并排制作 2 个极坐标图
代码:
d = read.table("D:/POLAR_1.txt", sep="\t", header=T)
attach(d)
summary(d)
library(plotrix)
par(mfrow=c(1,2))
对于第一个极坐标图:
polar.plot(NA, NA, clockwise=TRUE, rp.type="", start=90,radial.lim=c(0, 35),
radial.cex=0.3, box.radial=TRUE, show.grid.labels=1, boxed.radial=FALSE)
polar.plot(g_d, g_a, clockwise=TRUE, rp.type="s", start=90, point.symbols=19,
show.grid.labels=3, par(cex=0.8), add=TRUE)
对于第二个极坐标图:
polar.plot(NA, NA, clockwise=TRUE, rp.type="", start=90,radial.lim=c(0, 35),
radial.cex=0.3, box.radial=TRUE, show.grid.labels=1, boxed.radial=FALSE, add=TRUE)
polar.plot(s_d, s_a, clockwise=TRUE, rp.type="s", start=90, point.symbols=19,
show.grid.labels=3, par(cex=0.8), add=TRUE)
结果:我可以获得第一个情节,但对于第二个情节,我收到以下消息:
错误报告:
Error in if (grid.pos[1] < radial.lim[1]) grid.pos <- grid.pos[-1] :
missing value where TRUE/FALSE needed
问题?
由于第二个数据集有一些缺失值(因为观察较少),所以我收到了这个错误。所以,想知道如何处理这个错误。