This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |