我想发布一个由nlme生成的augPred图,所以它需要看起来更好看一些(比如评论员)。我想重新排序面板和更改标题。我试着用我发现的点阵信息,但不知怎么的,它在nlme中不起作用。例如,我尝试过使用index.cond。它确实重新排序了面板,但没有按照我指定的顺序排列。
这是最初的数字:

我用这个dataset 数据尝试的代码,您将需要这个函数SSbgf:
library(nlme)
grow<-read.table("cobsgddv8.txt", header=T)
grow10<-subset(grow, grow$year == "2010")
grow10$EU<- with(grow10, factor(ground):factor(plot))
grow10G<-groupedData(mass ~ gdd | EU, data=grow10)
fit.beta.10 <- nlsList(mass ~ SSbgf(gdd, w.max, t.e, t.m), data = grow10G)
plot(intervals(fit.beta.10), layout = c(3,1))
fit.nlme.10<-nlme(fit.beta.10, random=pdDiag(w.max ~1))
fit.nlme3.10<-update(fit.nlme.10, random = list(w.max + t.m + t.e ~ 1))
plot(augPred(fit.nlme3.10), layout = c(4,6), xlab="", ylab="", ylim=c(-200,2700),
index.cond=list(c(3,8,4,7,2,5,6,1,9,12,10,11,24,21,22,23,20,18,19,17,13,14,15,16)))
#Order I am looking for
c("Above:12", "Above:21", "Above:35", "Above:43", "Above:15", "Above:23", "Above:32",
"Above:41", "Above:13", "Above:24", "Above:31", "Above:46","Below:12", "Below:21",
"Below:35", "Below:43", "Below:15", "Below:23", "Below:32", "Below:41", "Below:13",
"Below:24", "Below:31", "Below:46")))
#Panel titles I want
c("M", "M", "M", "M", "FP", "FP", "FP", "FP", "P", "P", "P", "P","M", "M", "M", "M",
"FP", "FP", "FP", "FP", "P", "P", "P", "P")发布于 2013-09-17 19:12:56
我认为改变面板顺序的最简单的方法是改变地块调用之外的因子的顺序。
dat22 = augPred(fit.nlme3.10)
dat22$.groups = factor(dat22$.groups,
levels = c("Above:12", "Above:21", "Above:35", "Above:43", "Above:15",
"Above:23", "Above:32", "Above:41", "Above:13", "Above:24",
"Above:31", "Above:46", "Below:12", "Below:21", "Below:35",
"Below:43", "Below:15", "Below:23", "Below:32", "Below:41",
"Below:13", "Below:24", "Below:31", "Below:46"))
plot(dat22, layout = c(4,6), xlab="", ylab="", ylim=c(-200,2700))若要更改每张带中的标题,可以使用factor.levels设置strip.custom。
plot(dat22, layout = c(4,6), xlab="", ylab="", ylim=c(-200,2700),
strip = strip.custom(factor.levels = c("M", "M", "M", "M", "FP", "FP", "FP", "FP", "P", "P",
"P", "P","M", "M", "M", "M", "FP", "FP", "FP", "FP", "P",
"P", "P", "P")))这取代了原来的名称,但我不完全确定您是想要增加名称还是完全更改它们。
https://stackoverflow.com/questions/18855872
复制相似问题