my_data <- read.table(file="ModScore.csv",
header=TRUE,
sep=",",
comment.char="#")
str(my_data)
## 'data.frame': 13 obs. of 2 variables:
## $ Peptide : chr "Y829" "Y829" "Y829" "Y917" ...
## $ Modscore: num 200 159 27.8 60.7 64.6 ...
library(ggplot2)
library(ggthemes)
library(patchwork)
qplot(x=my_data$Peptide, y=my_data$Modscore,geom="boxplot",fill=I("tomato"))
p <- ggplot(my_data, aes(x=Peptide, y=Modscore)) +
geom_boxplot()
print(p)
p + geom_jitter(shape=16, position=position_jitter(0.2)) + theme_bw()
p2 <- ggplot(my_data, aes(x=Peptide, y=Modscore)) +
geom_boxplot(fill='tomato', color="black")+
theme_classic()
print(p2)
Using built in R Faithful Dataset
mydata <- faithful
head(mydata)
## eruptions waiting
## 1 3.600 79
## 2 1.800 54
## 3 3.333 74
## 4 2.283 62
## 5 4.533 85
## 6 2.883 55
g1 <- ggplot(data=mydata, mapping=aes(x=waiting,y=eruptions)) + geom_point()
print(g1)
g1 + theme_classic(base_size=20,base_family="serif")
g2 <- ggplot(data=mydata) +
aes(x=waiting,y=eruptions) +
geom_point(size=2,
shape=21,
color="black",
fill="tomato") +
labs(title="Old Faithful Geyser Eruption Time vs Waiting Time ",
x="Waiting Time (minutes)",
y="Eruption Time (minutes)")
print(g2)