为了账号安全,请及时绑定邮箱和手机立即绑定

R语言里编码正确,为什么就是不输出图片呢?

R语言里编码正确,为什么就是不输出图片呢?

慕工程0101907 2019-03-03 10:04:50
# Create the data for the chart.H <- c(7,12,28,3,41)M <- c("Mar","Apr","May","Jun","Jul")# Give the chart file a name.png(file = "barchart_months_revenue.png")# Plot the bar chart.barplot(H,names.arg = M,xlab = "Month",ylab = "Revenue",col = "blue",main = "Revenue chart",border = "red")比如以上代码没有错,但是就是输不出来图片,为什么?
查看完整描述

1 回答

?
缥缈止盈

TA贡献2041条经验 获得超4个赞

图片已经输出了,只是保存在你的工作目录中,默认是“我的文档”,不是“我的图片”目录。你可以修改一下R软件的工作目录,或者指定文件保存的绝对路径png(file = "barchart_months_revenue.png"),再输出图片就可以方便找到。

我已试过你的代码,图片已经输出了,只是保存在“我的文档”。如图:



查看完整回答
反对 回复 2019-03-10
  • 1 回答
  • 0 关注
  • 881 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信