是否有一种简单的方法来转换R中的所有GUI元素并仅从OSX上的命令行运行它?
我试图在我的OSX机器上复制远程linux终端的行为.因此plot()应该只保存一个文件,CRAN镜像选择之类的东西应该是文本,而不是Tk接口.我无法找到设置此行为的位置.
我想将中值样条和相应的置信区间带添加到ggplot2散点图中.我正在使用'quantreg'包,更具体地说是rqss函数(Additive Quantile Regression Smoothing).
在ggplot2我能够添加中值样条曲线,但不是置信区间带:
fig = ggplot(dd, aes(y = MeanEst, x = N, colour = factor(polarization)))
fig + stat_quantile(quantiles=0.5, formula = y ~ qss(x), method = "rqss") +
geom_point()
Run Code Online (Sandbox Code Playgroud)
该quantreg-package本身自带的绘图功能; plot.rqss.我可以在哪里添加置信区间(bands=TRUE):
plot(1, type="n", xlab="", ylab="", xlim=c(2, 12), ylim=c(-3, 0)) # empty plot
plotfigs = function(df) {
rqss_model = rqss(df$MeanEst ~ qss(df$N))
plot(rqss_model, bands=TRUE, add=TRUE, rug=FALSE, jit=FALSE)
return(NULL)
}
figures = lapply(split(dd, as.factor(dd$polarization)), plotfigs)
Run Code Online (Sandbox Code Playgroud)
然而,quantreg-package …