R 中的plotCI 出现问题

问题描述 投票:0回答:1

我有 3 个向量高中低,其中每个条目的高 > 中 > 低。我正在尝试使用

plotCI
(来自
plotrix
包)绘制中间的高和低误差线,但它抛出了一个奇怪的警告,并且没有绘制误差线。

这是警告,并附上了它产生的情节。图中没有误差线。 plotCI

low=c(99.27495952,98.15727762,96.99430745,95.54882648,98.7267791,100.8045272,100.2463928,100.2923699,103.3861367,106.075732,104.9342403,105.8158236,108.7822833,111.0087796,110.4175143,110.3947246,112.7025088,116.1057355,116.2001705,116.7398338,118.4814787,121.5628204,122.6604009,121.8430757,123.8825586,127.3317445,128.4911912,129.1552713,132.528403,136.6003678,139.4004274,140.2465952,143.5078511,150.3004399,153.4350347,156.85757,162.3230386,170.237894,173.960331,175.3131762,181.4263439,187.9341692,191.0067462,192.106109,197.1090806,204.1746754,206.66286,209.0558393,214.1047155,220.1821571,223.8084984,225.7742667,227.9532666,234.9630895,237.0789857,238.749499,242.6495929,248.8593892,250.5438168,250.1758189,250.6833416,252.4127762,249.2812182,247.0495049,245.2963322,243.0571254,234.0241975,222.8951082,216.8119712,212.7235633,204.3580359,198.1979665,198.4796781,198.8047915,198.0378228,195.3497431,194.3248007,196.5547713,186.0839176,182.6934117,182.5559012,185.4762132,185.2516469,183.637137,190.6784627,195.1880502,195.2889283,194.9491831,207.1741868,213.0708294,209.4501257,208.4438794,218.9554403)

mid=c(102.7390142,101.5583946,100.3925114,99.01630428,102.0180895,104.3159645,103.5259517,103.7538282,107.0691789,109.646421,108.2475164,109.0864929,112.159572,114.4551993,113.753501,113.7243011,116.1547649,119.5686679,119.6795137,120.1905997,121.8290152,124.9951671,126.1407079,125.3098864,127.2754199,130.7091567,131.9076466,132.7564163,136.0589667,140.054201,142.7611985,143.7022023,147.0951063,153.8849342,157.0747887,160.4567101,165.7822942,173.8407077,177.4816763,178.7106439,185.0543961,191.5746477,194.7497274,195.5350958,200.6008151,207.6923934,210.2630338,212.5880917,217.4995903,223.6929482,227.316743,229.3164594,231.4328973,238.5383698,240.5090008,242.1640245,246.168329,252.2875479,254.067711,253.7259026,254.2442684,256.245147,253.0008708,250.6681554,248.8949181,246.6091059,237.7196148,226.5992715,220.6681247,217.0046205,210.4799624,202.192324,202.5494741,202.4746751,201.8393332,199.165078,198.2245013,200.5979514,189.8972863,186.530536,186.3866033,189.0785941,189.26942,187.3632148,194.4695402,199.1501539,199.0539904,198.8053916,211.3253922,216.9707109,213.5578239,212.3915531,222.8710144)

high=c(106.1435055,104.8735555,103.7855278,102.3511756,105.4923734,107.7774038,106.8994517,107.2127134,110.5363222,113.0388896,111.7375216,112.6044125,115.603212,117.7331509,117.2266195,117.0030352,119.5378656,122.9062976,123.1189211,123.4953242,125.195154,128.5045895,129.5972862,128.7258465,130.704213,134.1284254,135.2973488,136.172498,139.5373278,143.6566914,146.2132881,147.1326186,150.558332,157.4671276,160.6615895,164.1063058,169.3455784,177.531566,181.1547947,182.0970624,188.7424452,195.1488575,198.5885692,198.9719821,204.0360237,211.2575582,213.8238804,216.0740404,220.9482088,227.234598,230.8423984,232.7319172,234.8889679,241.960514,244.186293,245.6141959,249.7404648,255.9295765,257.6510425,257.2614224,257.6329611,260.0178623,256.6008487,254.1418089,252.5965851,250.3462376,241.492117,230.3072822,224.6829776,221.1099612,219.4173667,206.1759769,206.4404416,206.0948832,205.4847547,202.8356172,201.9045409,204.7273175,193.8670148,190.3088702,190.2404722,192.6556236,193.180314,191.044858,198.4353299,203.0941369,202.6656409,202.440261,215.3606553,220.7901332,217.5626987,216.3629675,226.9369216)

> all(high > mid)
\[1\] TRUE
> all(mid > low)
\[1\] TRUE
 plotCI(1:93,mid,ui=high,li=low)

有 50 个或更多警告(使用 warnings() 查看前 50 个)

> warnings()
Warning messages:
1: In arrows(x, li, x, pmax(y - gap, li), col = barcol, lwd = lwd,  ... :
  zero-length arrow is of indeterminate angle and so skipped][2]
r plot confidence-interval
1个回答
0
投票

我遇到了和你一样的问题。 XD

请尝试在plotCI()中添加gap=0,以消除CI区间和坐标点之间的间隙。然后 CI 区间将显示为一条完整的直线。

© www.soinside.com 2019 - 2024. All rights reserved.