Skip to content

Instantly share code, notes, and snippets.

@t-student
Last active October 14, 2015 05:57
Show Gist options
  • Save t-student/3daedf26a85b0874185e to your computer and use it in GitHub Desktop.
Save t-student/3daedf26a85b0874185e to your computer and use it in GitHub Desktop.
# Create scatter with text label on the points
library(ggplot2)
p <- ggplot(data = df2, aes(x = idnum, y = response, label = id))
p <- p + geom_point()
p <- p + geom_text(aes(label=id),hjust=0, vjust=0, size=3)
p <- p + geom_smooth(method = 'loess', se = F)
p <- p + xlab("Fitted FEV1")
p <- p + ylab("Standardised residuals")
p <- p + theme_bw()
p <- p + theme(legend.title=element_blank())
p <- p + theme(legend.position='bottom')
p <- p + theme(text = element_text(size=10))
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment