Hi:
Here's one way:
DF <- read.table(header = TRUE, stringsAsFactors = FALSE, text = "
year month day temp precip date
2008 1 1 -10 0.0 2008-01-01
2008 1 2 5 NA 2008-01-02
2008 1 3 2 0.1 2008-01-03
2008 1 4 1 0.2 2008-01-04
2008 1 5 2 0.1 2008-01-05
2008 1 6 -3 0.2 2008-01-06
2008 1 7 -8 NA 2008-01-07")
DF$date <- as.Date(DF$date)
# Find the day of the week and produce an abbreviated day label
library(lubridate)
DF$dow <- wday(DF$date, label = TRUE)
# Use geom_text to position the text
library(ggplot2)
ggplot(DF, aes(x = day, y = temp)) +
geom_point(color = "darkorange") +
geom_text(aes(x = day + 0.1, label = dow), size = 3, hjust = 0)
Dennis
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.