ggplot最近有什么大的变化??R2.15.1; ggplot2_0.9.2
以前写的一个ggplot做图的小段子如下:
<br />
> if(length(eta.name) >= 1 & length(cat.cov) >=1){<br />
+ myplot("ETA_vs_cat.covariates")<br />
+ for(ii in 1:length(eta.name)) {<br />
+ for(jj in 1:length(cat.cov)){<br />
+ tmp <- subset(x, select = c("ID", eta.name[ii], cat.cov[jj]))<br />
+ tmp <- (unique(tmp))[-1]<br />
+ print(<br />
+ ggplot(tmp, aes(factor(tmp[,c(cat.cov[jj])]), tmp[,c(eta.name[ii])]))+<br />
+ geom_boxplot(colour="#56B4E9", outlier.colour="#56B4E9", outlier.shape=1)+<br />
+ labs(y = eta.name[ii], x = cat.cov[jj])+<br />
+ opts(title = "Boxplots of ETAs \n by Categorical Covariate")<br />
+ )<br />
+ makeFootnote(myfootnote)<br />
+ }<br />
+ }<br />
+ dev.off()<br />
+ }<br />
</p>
现在运行后怎么有如下warning
<br />
null device<br />
1<br />
Warning messages:<br />
1: 'opts' is deprecated.<br />
Use 'theme' instead.<br />
See help("Deprecated")<br />
2: In opts(title = "Boxplots of ETAs \n by Categorical Covariate") :<br />
Setting the plot title with opts(title="...") is deprecated. Use labs(title="...") or ggtitle("...") instead.<br />
3: 'opts' is deprecated.<br />
Use 'theme' instead.<br />
See help("Deprecated")<br />
4: In opts(title = "Boxplots of ETAs \n by Categorical Covariate") :<br />
Setting the plot title with opts(title="...") is deprecated. Use labs(title="...") or ggtitle("...") instead.<br />
5: 'opts' is deprecated.<br />
Use 'theme' instead.<br />
See help("Deprecated")<br />
6: In opts(title = "Boxplots of ETAs \n by Categorical Covariate") :<br />
Setting the plot title with opts(title="...") is deprecated. Use labs(title="...") or ggtitle("...") instead.<br />
7: 'opts' is deprecated.<br />
Use 'theme' instead.<br />
See help("Deprecated")<br />
8: In opts(title = "Boxplots of ETAs \n by Categorical Covariate") :<br />
Setting the plot title with opts(title="...") is deprecated. Use labs(title="...") or ggtitle("...") instead.<br />
</p>