R Multiplots in ggplot2

By |2018-08-31T12:55:49-04:00August 31st, 2018|Categories: Note笔记, Technique技术|Tags: , , , |

#Multiplot in ggplot2 install.packages("gridExtra") library("gridExtra") install.packages("cowplot") library("cowplot") df <- ToothGrowth # Convert the variable dose from a numeric to a factor variable df$dose <- as.factor(df$dose) head(df) #----Cowplot---- # The cowplot package is an extension to ggplot2 #and it can be used to provide a publication-ready plots. library(cowplot) # Default plot bp <- ggplot(df, aes(x=dose, y=len, color=dose)) [...]