R 在boxplot画图时遇到的问题1

报错:“plot.new() : figure margins too large”

出现该问题的原因是,RStudio里的【Plots】窗口太小,可以适当调大一点,或者把RStudio设置为全屏。解决步骤如下。
  1.用鼠标选中【Plots】选项卡,然后把该窗口拖大一点即可,如图(2)所示。

图(2) 将【Plots】窗口拖大

2. 测试代码   //数据源 drink.txt   index heat caffeine Na price 1 207.2 3.3 15.5 2.8 2 36.8 5.9 12.9 3.3 3 72.2 7.3 8.2 2.4 4 36.7 0.4 10.5 4.0 5 121.7 4.1 9.2 3.5 6 89.1 4.0 10.2 3.3 7 146.7 4.3 9.7 1.8 8 57.6 2.2 13.6 2.1 9 95.9 0.0 8.5 1.3 10 199.0 0.0 10.6 3.5 11 49.8 8.0 6.3 3.7 12 16.6 4.7 6.3 1.5 13 38.5 3.7 7.7 2.0 14 0.0 4.2 13.1 2.2 15 118.8 4.7 7.2 4.1 16 107.0 0.0 8.3 4.2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
     //ceshi.R

drink <- read.table(“G:/myProject/RDoc/Unit3/rChap1/drink.txt”,header
= T) drink <- drink[,-1] d=dist(drink) hc1=hclust(d,method=“ward.D2”) #离差平方和法 hc2=hclust(d,method=“single”) #最短距离法 hc3=hclust(d,method=“complete”) #最长距离法 hc4=hclust(d,method=“median”)
#中间距离法 opar=par(mfrow=c(2,2)) #分割绘图区域 plot(hc1,hang=-1);plot(hc2,hang=-1);plot(hc3,hang=-1);plot(hc4,hang=-1)
par(opar) #释放绘图区域分割 ————————————————
版权声明:本文为CSDN博主「sanqima」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sanqima/article/details/51339341

(我也不是很清楚反正调好了orz)

> xx <- 1:10/5
> boxplot(xx)
> summary(xx)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.20    0.65    1.10    1.10    1.55    2.00 

箱状图元素、意义参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值