Skip to content

Commit

Permalink
commenting out github workflow in data viz lesson + switching Year to…
Browse files Browse the repository at this point in the history
… year so the colimn is recognized
  • Loading branch information
camilavargasp committed Jan 24, 2024
1 parent e1dc9be commit 6b1800c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions materials/sections/visualization-ggplot-leaflet.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ annual_esc_2000s <- annual_esc %>%
filter(year %in% c(2000:2016))
## Quick check
unique(annual_esc_2000s$Year)
unique(annual_esc_2000s$year)
## Plot with facets
Expand Down Expand Up @@ -475,7 +475,7 @@ ggplot(annual_esc_2000s,
```


You can also save all your code into an object in your working environment by assigning a name to the `ggplot()` code.
<!--- You can also save all your code into an object in your working environment by assigning a name to the `ggplot()` code.
```{r}
Expand Down Expand Up @@ -552,14 +552,15 @@ ggplot(n_years,
```
-->

#### Saving plots

Saving plots using `ggplot` is easy! The `ggsave()` function will save either the last plot you created, or any plot that you have saved to a variable. You can specify what output format you want, size, resolution, etc. See `?ggsave()` for documentation.

```{r}
#| eval: false
ggsave("figures/nyears_data_kus.jpg", width = 8, height = 6, units = "in")
ggsave("figures/salmon_esc_region.jpg", width = 8, height = 6, units = "in")
```


Expand Down Expand Up @@ -642,6 +643,8 @@ leaflet(locations) %>%
Leaflet has a ton of functionality that can enable you to create some beautiful, functional maps with relative ease. [Here](https://pages.github.nceas.ucsb.edu/NCEAS/sasap-data/language_vis.html) is an example of some we created as part of the [State of Alaskan Salmon and People (SASAP) project](https://www.nceas.ucsb.edu/workinggroups/state-alaskan-salmon-and-people-sasap), created using the same tools we showed you here. This map hopefully gives you an idea of how powerful the combination of R Markdown and GitHub Pages can be.


<!--
## Publish the Data Visualization lesson to your webpage
::: callout-tip
Expand All @@ -655,6 +658,8 @@ Leaflet has a ton of functionality that can enable you to create some beautiful,
:::
-->

## `ggplot2` Resources

- [Why not to use two axes, and what to use instead: The case against dual axis charts](https://blog.datawrapper.de/dualaxis/) by Lisa Charlotte Rost.
Expand Down
1 change: 1 addition & 0 deletions materials/session_10.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ format:
---



{{< include /sections/visualization-ggplot-leaflet.qmd >}}

0 comments on commit 6b1800c

Please sign in to comment.