Sie sind auf Seite 1von 1

Categorical

scatterplots with R for biologists: a step-by-step guide


Step 1. Format data set Step 2. Run R script
Replicate Condition Value #1 Reset the console
Rep 1 - jul. 2016 Wild type 14.5 rm(list=ls())
#2 Call the library ggplot2
Rep 1 - jul. 2016 Wild type 14.3 library('ggplot2')
Rep 1 - jul. 2016 Wild type 13.7 #3 Import the .csv file and store it in an object called dataset
Rep 1 - jul. 2016 Mutant A 14.3 dataset<-read.table(file.choose(), sep=",", header=T, dec=".", fill=TRUE)
#4 Attach dataset
Rep 1 - jul. 2016 Mutant A 19.5 attach(dataset)
Rep 1 - jul. 2016 Mutant A 16.7 #5 Display the top of dataset
Rep 1 - jul. 2016 Mutant B 12.6 head(dataset)
#6 Generate the graph and store it in the object named graph.
Rep 1 - jul. 2016 Mutant B 13.8 graph <- ggplot(dataset, aes(factor(Condition), Value))
Rep 1 - jul. 2016 Mutant B 9.3 #7 Display the graph in a separate window.
Rep 2 - aug. 2016 Wild type 14.1 graph + geom_boxplot(outlier.colour='black', colour='black') + geom_jitter(aes(col=Replicate)) + theme_bw()
Rep 2 - aug. 2016 Wild type 13.5
Rep 2 - aug. 2016
Rep 2 - aug. 2016
Wild type
Mutant A
14.2
22.7
Step 3. Format output graph
Rep 2 - aug. 2016 Mutant A 24.8 25
Rep 2 - aug. 2016 Mutant A 14.9
Rep 2 - aug. 2016 Mutant B 12.6
Rep 2 - aug. 2016 Mutant B 12.8 20
Rep 2 - aug. 2016 Mutant B 14.2 Replicate
Rep 3 - sept. 2016 Wild type 16.6 Rep 1 - jul. 2016
Value

Rep 3 - sept. 2016 Wild type 8.7 Rep 2 - aug. 2016


15
Rep 3 - sept. 2016 Wild type 13.3 Rep 3 - sept. 2016
Rep 3 - sept. 2016 Mutant A 17.1
Rep 3 - sept. 2016 Mutant A 20.1
Rep 3 - sept. 2016 Mutant A 16.4 10
Rep 3 - sept. 2016 Mutant B 10.3
Rep 3 - sept. 2016 Mutant B 8.8 Mutant A Mutant B Wild type
Rep 3 - sept. 2016 Mutant B 9.6 factor(Condition)

Das könnte Ihnen auch gefallen