## Error in `library()`:
## ! there is no package called 'dplyr'
## Error in `library()`:
## ! there is no package called 'tidyr'
## Error in `library()`:
## ! there is no package called 'ggplot2'
data_frame(
x = rbinom(n = 1000, size = 10, prob = 0.7)
) %>%
ggplot(aes(x = x)) +
geom_density() +
geom_vline(aes(xintercept = 7, col = "red", alpha = 0.25))## Error in `data_frame(x = rbinom(n = 1000, size = 10, prob = 0.7)) %>% ggplot(aes(x = x))`:
## ! could not find function "%>%"
其中geom_vline中的v是vertical的缩写,因此是垂直线,因此对应的水平线代码是geom_hline。