-
Notifications
You must be signed in to change notification settings - Fork 806
Open
Description
Per the facet_wrap()
documentation, the tilde notation in the facets
argument is for "compatibility with the classic interface". It appears vars()
should be used instead.
There are a few places in this book where facet_wrap()
uses the tilde. It may be best to convert to vars()
.
For example, near the end of chapter 1 is this code example:
ggplot(frequency, aes(x = proportion, y = `Jane Austen`,
color = abs(`Jane Austen` - proportion))) +
geom_abline(color = "gray40", lty = 2) +
geom_jitter(alpha = 0.1, size = 2.5, width = 0.3, height = 0.3) +
geom_text(aes(label = word), check_overlap = TRUE, vjust = 1.5) +
scale_x_log10(labels = percent_format()) +
scale_y_log10(labels = percent_format()) +
scale_color_gradient(limits = c(0, 0.001),
low = "darkslategray4", high = "gray75") +
facet_wrap(~author, ncol = 2) +
theme(legend.position="none") +
labs(y = "Jane Austen", x = NULL)
The facet_wrap()
function call may be changed to facet_wrap(vars(author), ncol = 2)
.
In chapter 2 is this code example:
ggplot(jane_austen_sentiment, aes(index, sentiment, fill = book)) +
geom_col(show.legend = FALSE) +
facet_wrap(~book, ncol = 2, scales = "free_x")
The facet_wrap()
function call may be changed to facet_wrap(vars(book), ncol = 2, scales = "free_x")
.
Metadata
Metadata
Assignees
Labels
No labels