R - plotting notes

Setup library(ggplot2) library(gridExtra) Distribution size <- 100 vect <- seq(1, size, by=1) m <- mean(vect) std <- sqrt(var(vect)) distF <- data.frame( indx = vect, gaus = dnorm(vect, mean=m, sd=std), pois = dpois(vect, vect), unif = dunif(vect, min=1, max=size) ) g1 <- ggplot(data=distF, aes(x=indx, y=gaus)) + geom_point(shape=1) + guides(legend.title=element_blank()) g2 <- ggplot(data=distF, aes(x=indx, y=pois)) + geom_point(shape=1) g3 <- ggplot(data=distF, aes(x=indx, y=unif)) + geom_point(shape=1) grid.arrange(g1, g2, g3, ncol=3)` Random sampling randF <- data.
Read more...