Multiple plots with different titles using ggplot lapply…


http://salamandra-vet.pl/?plasmamerez=randki-z-facetami&062=86 Multiple plots with different titles using ggplot, lapply, and do.call.

Mino parameters = data.frame(p1=letters[1:5], p2=round(rnorm(5),2)) l = replicate(5, data.frame(x=1:10, y=rnorm(10)), simplify=FALSE) names(l) = do.call(paste, c(parameters, sep=","))   plot_one = function(x) ggplot(data = l[[x]]) + geom_path(aes(x, y)) + opts(title = x)   plots = lapply(names(l), plot_one)   do.call(gridExtra::grid.arrange, plots)

el banco mas bonito Created by Pretty R at inside-R.org

http://stackoverflow.com/questions/10726470/ggplot-over-many-data-frames-changing-titles


Leave a Reply

Your email address will not be published.