Error in plot.new() : figure margins too large

目录

Error in plot.new() : figure margins too large

#问题

#解决

完整错误:


#问题

拟合回归模型并计算每一个样本的dfbetas值,最佳dfbetas阈值,最后可视化每个样本对每个预测变量的影响程度;

#fit a regression model
model <- lm(mpg~disp+hp, data=mtcars)#view model summary
summary(model)#calculate DFBETAS for each observation in the model
dfbetas <- as.data.frame(dfbetas(model))#display DFBETAS for each observation
dfbetas#find number of observations
n <- nrow(mtcars)#calculate DFBETAS threshold value
thresh <- 2/sqrt(n)thresh#specify 2 rows and 1 column in plotting region#dev.off()
#par(mar = c(1, 1, 1, 1))par(mfrow=c(2,1))#plot DFBETAS for disp with threshold lines
plot(dfbetas$disp, type='h')
abline(h = thresh, lty = 2)
abline(h = -thresh, lty = 2)#plot DFBETAS for hp with threshold lines
plot(dfbetas$hp, type='h')
abline(h = thresh, lty = 2)
abline(h = -thresh, lty = 2)

#解决

par(mar = c(1, 1, 1, 1))

#fit a regression model
model <- lm(mpg~disp+hp, data=mtcars)#view model summary
summary(model)#calculate DFBETAS for each observation in the model
dfbetas <- as.data.frame(dfbetas(model))#display DFBETAS for each observation
dfbetas#find number of observations
n <- nrow(mtcars)#calculate DFBETAS threshold value
thresh <- 2/sqrt(n)thresh#specify 2 rows and 1 column in plotting region#dev.off()
par(mar = c(1, 1, 1, 1))par(mfrow=c(2,1))#plot DFBETAS for disp with threshold lines
plot(dfbetas$disp, type='h')
abline(h = thresh, lty = 2)
abline(h = -thresh, lty = 2)#plot DFBETAS for hp with threshold lines
plot(dfbetas$hp, type='h')
abline(h = thresh, lty = 2)
abline(h = -thresh, lty = 2)

完整错误:

> par(mfrow=c(2,1))

> #plot DFBETAS for disp with threshold lines
> plot(dfbetas$disp, type='h')
Error in plot.new() : figure margins too large
> abline(h = thresh, lty = 2)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet
> abline(h = -thresh, lty = 2)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet

> #plot DFBETAS for hp with threshold lines 
> plot(dfbetas$hp, type='h')
Error in plot.new() : figure margins too large
> abline(h = thresh, lty = 2)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet
> abline(h = -thresh, lty = 2)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet

参考:R

参考:How to Calculate DFBETAS in R

参考:How to Fix: error in plot.new() : figure margins too large

参考:Error in plot.new() : figure margins too large, Scatter plot

Error in plot.new() : figure margins too large相关推荐

  1. Error in plot.new(): figure margins too large

    Error in plot.new(): figure margins too large 目录 Error in plot.new(): figure margins too large 问题: 解 ...

  2. R语言错误 --> Error in plot.new() : figure margins too large

    [问题描述] 在RStudio中运行R命令绘图时,出现如下错误: Error in plot.new() : figure margins too large [解决办法] 在绘图命令前,加上一句代码 ...

  3. 解决RStudio中plot.new() : figure margins too large问题

    在RStudio中使用plot()函数进行画图时,常出现"plot.new() : figure margins too large"问题.如图(1)所示. 出现该问题的原因是,R ...

  4. R绘图: figure margins too large错误

    最近在研究分类器,鸢尾花数据用得审美疲劳了,就从网上找了一个breast-cancer-wisconsin数据集. 建模前照例是做一些描述性统计,看下样本特征.数据集有9个自变量,1个因变量标签,先简 ...

  5. r语言 figure margins too large

    r语言错误如下图(数字边距太大) 解决方法:点plots界面的扫帚清空图像

  6. mysql错误码1709_MySQL5.6出现ERROR 1709 (HY000): Index column size too large问题的解决方法...

    一.问题 mysql 5.6 出现如下问题: [ERROR 1709 (HY000): Index column size too large. The maximum column size is ...

  7. r语言报错|Error in plot.window(...) : ‘xlim‘值不能是无限的

    plot()绘制图层时报错 错误提示: Error in plot.window(...) : 'xlim'值不能是无限的 In addition: Warning messages: 1: In m ...

  8. 【r语言plot报错】Error in plot.window(...) : ‘xlim‘值不能是无限的/ need finite ‘xlim’ values

    使用r语言plot函数绘图时,遇到[Error in plot.window(-) : 'xlim'值不能是无限的(need finite 'xlim' values)]的报错. 其中x轴为字符串序列 ...

  9. matplotlib基础函数函数 plot, figure

    matplotlib.pyplot.plot(*args, scalex=True, scaley=True,data=None,**kwargs) 用线段和标记去绘制x和y.调用签名: plot([ ...

最新文章

  1. 使用mock解决测试中依赖第三方接口的问题
  2. PPT 下载 | 数据治理中的一些挑战与应用
  3. 「技术人生」:技术同学应该如何理解业务?
  4. 三分钟让面试官满意系列 - Bagging和Boosting 的联系及区别
  5. 都是宝宝:北京孩子3成不玩电子游戏睡眠状况最好 江苏孩子起得最早
  6. Oracle学习总结(5)—— SQL语句经典案例
  7. 归并排序MergeSort
  8. 改变php默认目录结构,ThinkPHP中自定义目录结构的设置方法_PHP
  9. iapp进度条倒计时_‎App Store 上的“纪念日提醒 - days matter · 倒数倒计时”
  10. 协议栈之packet_type
  11. 【kimol君的无聊小发明】—用python写音乐下载器
  12. java返回图片base64_java将图片转为base64返回给前端
  13. java基础程序设计
  14. Ubuntu支持LinuxONE大型机:为云而生的强强新组合
  15. 如何解决SSL/TLS证书服务的高可用性?
  16. 香港svg 3d地图
  17. File-Upload
  18. 暖芯迦推出可编程神经调控平台芯片-元神ENS001
  19. 阿桑奇:维基解密将把CIA网络攻击工具资料提供给科技公司
  20. Vue中使用js-audio-recorder插件实现录音功能并实现上传Blob数据到SpringBoot后台接口

热门文章

  1. ♥看二本学渣如何进腾讯 分享面试经验、职场感悟、硬核知识、大厂内推♥
  2. JSP内置对象-out
  3. php header setcookie,php中header头设置Cookie与内置setCookie的区别,和js对cookie操作
  4. java 移动平均值_使用用户输入数组移动平均线
  5. 二阶系统阶跃响应实验_自控原理二阶系统阶跃响应及性能分析实验报告
  6. 03Django基本应用结构
  7. 04Strategy(策略)模式
  8. mysql分区和分表比较_MySQL分区和分表的区别与联系
  9. MonoScene: 单目3D语义场景补全
  10. YOLOV5 的小目标检测网络结构优化方法汇总(附代码)