library(ggplot2)
# Get ggplot object without displaying
fd <- fdata(matrix(rnorm(200), 20, 10))
p <- autoplot(fd)
# Customize the plot
p + theme_minimal()
# Color by numeric variable
y <- rnorm(20)
autoplot(fd, color = y)
# Color by category with mean and CI
groups <- factor(rep(c("A", "B"), each = 10))
autoplot(fd, color = groups, show.mean = TRUE, show.ci = TRUE)
Run the code above in your browser using DataLab