plot-octane.R (1064B)
1 #!/usr/bin/env Rscript 2 3 # Usage: 4 # 5 # octane.R control.csv variable.csv 6 # 7 # Output will be placed in Rplots.pdf 8 # 9 # Remember: on Octane, higher is better! 10 11 library(ggplot2) 12 13 args <- commandArgs(trailingOnly = TRUE) 14 15 # Reading in data. 16 control <- read.table(args[1], sep=",", header=TRUE) 17 variable <- read.table(args[2], sep=",", header=TRUE) 18 19 # Pulling out columns that we want to plot. 20 # Not totally necessary. 21 ctrl <- control$Score..version.9. 22 var <- variable$Score..version.9. 23 24 # Concatenating the values we want to plot. 25 score <- c(ctrl, var) 26 # Creating a vector of labels for the data points. 27 label <- c(rep("control", length(ctrl)), rep("variable", length(var))) 28 29 # Creating a data frame of the score and label. 30 data <- data.frame(label, score) 31 32 # Now plotting! 33 ggplot(data, aes(label, score, color=label, pch=label)) + 34 # Adding boxplot without the outliers. 35 geom_boxplot(outlier.shape=NA) + 36 # Adding jitter plot on top of the boxplot. If you want to spread the points 37 # more, increase jitter. 38 geom_jitter(position=position_jitter(width=0.05))