Skip to content

Instantly share code, notes, and snippets.

View aousabdo's full-sized avatar
💭
I may be slow to respond.

aousabdo aousabdo

💭
I may be slow to respond.
View GitHub Profile
# start clean
rm(list=ls())
# load libraries
library(data.table)
DT <- data.table(A = rnorm(10), B = rnorm(10))
# this gives lots of warnings, there seems to be a better way of doing this
names(DT) <- tolower(names(DT))
library(ggplot2)
library(gridExtra)
mtcars$cyl <- ordered(mtcars$cyl)
p <- ggplot(mtcars, aes(mpg, hp, colour = cyl)) + geom_point()
p1 <- p + theme(legend.position = "none")
p2 <- ggplot(mtcars, aes(x=mpg, group=cyl, colour=cyl))
p2 <- p2 + stat_density(fill = NA, position="dodge")