Skip to content

Commit 0a45406

Browse files
committed
Update Data_Visualization.Rmd
1 parent 7cbc613 commit 0a45406

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

modules/Data_Visualization/Data_Visualization.Rmd

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ ggplot(er_visits_all, aes(x = year, y = rate, group = county)) +
366366
`scale_x_continuous()` and `scale_y_continuous()` can change how the axis is plotted. Can use the `breaks` argument to specify how you want the axis ticks to be.
367367

368368
```{r, fig.width=5, fig.height=3, fig.align='center'}
369-
range(pull(Orange, circumference))
370-
range(pull(Orange, age))
371-
plot_scale <-ggplot(Orange, aes(x = circumference, y = age)) +
372-
geom_point(size = 5, color = "red", alpha = 0.5) +
373-
geom_line(size = 0.8, color = "brown", linetype = 2) +
374-
scale_x_continuous(breaks = seq(from = 20, to = 240, by = 20)) +
375-
scale_y_continuous(breaks = seq(from = 100, to = 1600, by = 200))
369+
range(pull(er_visits_all, year))
370+
371+
ggplot(er_visits_all, aes(x = year, y = rate, group = county)) +
372+
geom_point(size = 5, color = "green", alpha = 0.5) +
373+
geom_line(size = 0.8, color = "blue", linetype = 2) +
374+
scale_x_continuous(breaks = seq(from = 2011, to = 2022, by = 1))
375+
376376
```
377377

378378
## Changing axis: specifying axis limits
@@ -381,11 +381,12 @@ plot_scale <-ggplot(Orange, aes(x = circumference, y = age)) +
381381

382382
```{r, fig.width=5, fig.height=3, fig.align='center'}
383383
384-
ggplot(Orange, aes(x = circumference, y = age)) +
385-
geom_point(size = 5, color = "red", alpha = 0.5) +
386-
geom_line(size = 0.8, color = "brown", linetype = 2) +
387-
labs(title = "My plot of orange tree circumference vs age") +
388-
xlim(100, max(pull(Orange, circumference)))
384+
ggplot(er_visits_all, aes(x = year, y = rate, group = county)) +
385+
geom_point(size = 5, color = "green", alpha = 0.5) +
386+
geom_line(size = 0.8, color = "blue", linetype = 2) + labs(title = "My plot of Heat-Related ER Visits in CO",
387+
x = "Year",
388+
y = "Age-adjusted Visit Rate") +
389+
ylim(0, max(pull(er_visits_all, rate)))
389390
390391
```
391392

0 commit comments

Comments
 (0)