我需要从 R 导出图形以用于不同的出版物格式,即科学海报、Journal Articel、Powerpoint 演示文稿。只要我不知道使用 R-Markdown 和 Latex 或 Sweave 来制作 pdf 幻灯片,我就需要使用 Microsoft 应用程序。
我用 ggplot2 在 R 中做图形。
我的 MWE
df1 <- expand.grid(Year = c(2000, 2010),
Treat = c("TreatA","TreatB"),
Location = c("Berlin", "Munich", "Kansas", "Paris"),
rep = c(1,2,3,4,5,6,7,8,9,10))
df1 <- cbind(df1,
Var1 = runif(160, -10,25) + rnorm(160,8,4))
Run Code Online (Sandbox Code Playgroud)
我的图形代码:
p1 <- ggplot(aes(y = Var1, x = Treat, na.rm=TRUE, fill=Location), data = df1) +
stat_boxplot(geom ='errorbar', width= 0.5) +
geom_boxplot(outlier.shape = 1, outlier.size = 2, linetype="solid", size = 1) + …Run Code Online (Sandbox Code Playgroud)