Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandk/2781905 to your computer and use it in GitHub Desktop.
Save briandk/2781905 to your computer and use it in GitHub Desktop.
Nan's Question
test<-data.frame(a=c(2,2,2,4,4,4,4,6,6,6,6,6,6,8,8,8,10,10,10,10,10,10,10),Pre=c(100,110,90,100,120,130,170,150,150,120,140,150,120,90,90,100,40,50,40,40,20,60,30),Post=c(b-15))
testMelt <- melt(
test,
id = c("a"),
measured = c("Pre", "Post")
)
p <- ggplot(
aes(
x = factor(a),
y = value,
fill= variable
),
data = testMelt) +
geom_boxplot() +
stat_smooth(aes(group=variable,x=factor(a),y=value,fill=factor(variable),data=testMelt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment