Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ library(ggplot2)
library(dplyr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)

txhousing %>%
mutate(date = make_date(year, month, 1)) %>%
group_by(city) %>%
filter(min(sales) > 5e2) %>%
txhousing |>
mutate(date = make_date(year, month, 1)) |>
group_by(city) |>
filter(min(sales) > 5e2) |>
ggplot(aes(date, sales, group = city)) +
geom_line(na.rm = TRUE) +
scale_x_date(
Expand All @@ -81,8 +81,8 @@ txhousing %>%
#| break of that year. The y axis uses `scales::breaks_extended()` to request
#| 8 breaks, though only 6 are ultimately provided, and
#| `scales::label_dollar()` to format the label as a dollar value.
economics %>%
filter(date < ymd("1970-01-01")) %>%
economics |>
filter(date < ymd("1970-01-01")) |>
ggplot(aes(date, pce)) +
geom_line() +
scale_x_date(NULL,
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ library(ggplot2)
library(dplyr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)

txhousing %>%
mutate(date = make_date(year, month, 1)) %>%
group_by(city) %>%
filter(min(sales) > 5e2) %>%
txhousing |>
mutate(date = make_date(year, month, 1)) |>
group_by(city) |>
filter(min(sales) > 5e2) |>
ggplot(aes(date, sales, group = city)) +
geom_line(na.rm = TRUE) +
scale_x_date(
Expand All @@ -66,8 +66,8 @@ txhousing %>%
<img src="man/figures/README-labels-1.png" alt="A line plot created with ggplot2, showing property sales in Texas. The x scale uses `scales::break_width()` to place breaks every second year, and `scales::label_date()` to create a custom format for the labels. The y-scale uses `scales::label_number()` to reformat the labels with `scales::cut_short_scale()`." />

``` r
economics %>%
filter(date < ymd("1970-01-01")) %>%
economics |>
filter(date < ymd("1970-01-01")) |>
ggplot(aes(date, pce)) +
geom_line() +
scale_x_date(NULL,
Expand Down
Loading