【发布时间】:2019-03-25 20:54:44
【问题描述】:
非常基本的问题,给出代码:
f_chi_squared <- function(x, r) {
return ( (x^(r/2 - 1) * exp(1)^(-x/2)) / ( gamma(0.5*r) * 2^(r/2) ) )
}
this_chi_squared <- function(x) {
return (f_chi_squared(x, 2))
}
plot(this_chi_squared)
我在 X 和 Y 轴上没有得到任何数字。
我想在 x 和 y 轴上有数字,而不是像这样让它们空白。
我正在使用 Rstudio。当我绘制离散点时也会出现问题。
添加dev.off后
我明白了
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file '/tmp/RtmpQFaYTk/rs-graphics-32344720-c968-4c9e-b94a-0b9de3edf7db/.snapshot', probable reason 'No such file or directory'
Graphics error: Plot rendering error
【问题讨论】:
-
可能您无意中运行了一些覆盖默认设备选项的代码。尝试运行
dev.off()来重置设备。如果这不起作用,请重新启动 R -
另外
xlab和ylab不显示 -
@Gregor 谢谢,但我收到了这个新错误(添加到问题中)
-
你在重启 R 时遇到了这个错误??
-
@Gregor 我使代码更具重现性,当我运行添加了
dev.off()的代码时出现错误