daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # set up the plot
  2. myplot <- qplot(data=tnffinal, log_100m, log_1500m, color=Female)
  3. # add Least Squares fit lines (you can chose other methose like Loess)
  4. myplot_fit <- myplot+geom_smoot(method=lm)
  5. # output graph
  6. myplot_fit
  7.    
  8. tnffinal = data.frame(
  9.   log_100m = c(rnorm(10), rnorm(10,5)),
  10.   log_1500m = c(rnorm(10), rnorm(10,5)),
  11.   Female = factor(rep(0:1, each = 10))
  12. )
  13. library(ggplot2)
  14. myplot <- qplot(data=tnffinal, log_100m, log_1500m, color=Female)
  15. # add Least Squares fit lines (you can chose other methose like Loess)
  16. myplot_fit <- myplot+geom_smooth(aes(group = Female),method=lm,)
  17. # output graph
  18. myplot_fit
RAW Paste Data
Top