Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging june 2024 training into main #490

Merged
merged 37 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
361c7f0
Setting up book structure according to course schedule
camilavargasp Apr 30, 2024
1ba0d95
adding qmd with info on how to install R and git in personal computer
camilavargasp Apr 30, 2024
6d489ee
adding schedule + learning goals and course description
camilavargasp May 30, 2024
757b5ed
adding images for appendicx section on installing R and git in person…
camilavargasp May 30, 2024
6c89ee2
minor change to trigger book build
camilavargasp Jun 2, 2024
9439f67
fixed typos in spatial section
angelchen7 Jun 3, 2024
d3444bd
fixed file path for `ak_rivers_simp.shp`
angelchen7 Jun 3, 2024
8aab9d5
fixed `ggspatial` code chunk
angelchen7 Jun 3, 2024
8577474
improved the explanation for CRS
angelchen7 Jun 3, 2024
19a182b
fixed hyperlinks in github intro lesson
angelchen7 Jun 4, 2024
fea473a
deleted duplicate paragraph and fixed hyperlinks in github collaborat…
angelchen7 Jun 4, 2024
6cd840c
added new images to spatial lesson
angelchen7 Jun 4, 2024
5dc4bba
restructuring book to match udated schedule
camilavargasp Jun 5, 2024
bf972d2
Revising data managment lesson: added DataONE DLC + FAIR nad CARE des…
camilavargasp Jun 5, 2024
1678952
minor improvements to the wrangling lesson
angelchen7 Jun 5, 2024
e8cb0ae
fixed link in github intro lesson
angelchen7 Jun 5, 2024
53abdee
added a crucial step to the publishing analysis lesson
angelchen7 Jun 5, 2024
d199737
adding intro to R as an appendix
camilavargasp Jun 6, 2024
27ed422
reviewing and clarifying some of the answers to joins practice
camilavargasp Jun 6, 2024
6d625d1
fixed typos in the data visualization lesson
angelchen7 Jun 6, 2024
76deab0
adding shiny content + images associated to the lesson. Create a new …
camilavargasp Jun 7, 2024
63b78c4
replacing tidyverse for ggplo2 to avoid error when building the book.
camilavargasp Jun 7, 2024
ff3d79a
adding exersise results and common mistakes to shiny lesson
camilavargasp Jun 7, 2024
73211dc
updating literate analusis lesson to include here function and better…
camilavargasp Jun 10, 2024
4630b6f
replaced `ifelse()` with the tidyverse `if_else()` in the wrangling l…
angelchen7 Jun 11, 2024
4b5607a
removed the quotations in the `pivot_longer()` call
angelchen7 Jun 12, 2024
130b8d4
reordered function calls in `ggplot` code chunks
angelchen7 Jun 12, 2024
f6f0dff
adding more learning objectives + minor rephase of acknowledgement
camilavargasp Jun 11, 2024
07adefb
adding layout content to shiny lesson
camilavargasp Jun 12, 2024
5c2825e
Monor text updated to shiny lesson
camilavargasp Jun 12, 2024
3875389
adding 2-file-app example + text on publishing app
camilavargasp Jun 13, 2024
beae190
fixing typos and header numbers + adding comment on read data in glob…
camilavargasp Jun 13, 2024
e6b07a5
replacing RStudio for Posit in deploying app section
camilavargasp Jun 13, 2024
1d5112b
adding leaflet library to global.R
camilavargasp Jun 13, 2024
e1df249
replacing cutom theme function for actual theme code in shiny lesson
camilavargasp Jun 13, 2024
c819927
adding about.md text to final app solution code
camilavargasp Jun 13, 2024
f324b4f
Adding pdf to intro to reproducibility lesson + image adn updating th…
camilavargasp Jun 26, 2024
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
42 changes: 21 additions & 21 deletions materials/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ project:
output-dir: _book

book:
title: "UCSB Faculty Seminar Series: Grow Your Data & Team Science Skills"
# date: "January 22-26, 2024"
title: "NCEAS coreR for Delta Science Program"
subtitle: "June 10 - 13, 2024"
reader-mode: false

# NoteHD: cover image is not working
Expand All @@ -23,28 +23,28 @@ book:
- icon: twitter
href: https://twitter.com/ucsb_nceas
- icon: github
href: https://github.com/NCEAS/nceas-training/tree/2024-03-ucsb-faculty
href: https://github.com/NCEAS/nceas-training/tree/2024-06-delta

chapters:
- index.qmd # preface
- session_01.qmd # Intro and Lego
- session_02.qmd # Data Visualization
- session_03.qmd # Text Analysis (Casey)
- session_04.qmd # Survey data
- session_05.qmd # Visualizing spatial data (Rachel)
- session_06.qmd # GitHub for project management
- session_07.qmd # Publishing to Web
- session_08.qmd # GitHub Workflows
- session_09.qmd # Message Box
- session_10.qmd # Quarto Dashboards
- session_11.qmd # Practice Session
- session_12.qmd # reproducibility and provenance
- session_13.qmd # check PAT
# - session_14.qmd # Social Aspects of collab
# - session_15.qmd # Functions
# - session_16.qmd # Packages
# - session_17.qmd # Practice Session II
# - session_18.qmd # Data Portals
- session_01.qmd # Introduction
- session_02.qmd # R Setup
- session_03.qmd # Git and GitHub set up
- session_04.qmd # Literate Analysis
- session_05.qmd # Intro to Git and GitHub
- session_06.qmd # Tidy data
- session_07.qmd # Cleaning and Wrangling
- session_08.qmd # Practice Session I - joins
- session_09.qmd # Collaborating with Git
- session_10.qmd # Data Management
- session_11.qmd # Publishing to the Web
- session_12.qmd # Intro to Data Viz
- session_13.qmd # Spatial Data
- session_14.qmd # Practice Session II -lobter report
- session_15.qmd # Shiny
- session_16.qmd # Reproducibility and Provenence
- session_17.qmd # Appendix: Set up in personla comp
- session_18.qmd # Intro to R & RStudio
# - session_19.qmd # Spatial Data
# - session_20.qmd # Repro and Provenance

Expand Down
Binary file not shown.
Binary file added materials/images/2857-5903.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/R_RStudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/app1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/basic-widgets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/basic_shiny_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/create-repo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/geospatial-crs-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/geospatial-gcs-pcs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/input-output-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/install-pkg-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/multirow_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/navbarPage_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/one-vs-two.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/output-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/reactive-app-v1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/reactivity-intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/repo-structure-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/reproducibility_alibi_horst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/rstudio-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified materials/images/schedule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/shiny-hex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/sidebar_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/tabsetPanel_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/two-file-app-about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/two-file-app-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added materials/images/very-basic-app.png
24 changes: 14 additions & 10 deletions materials/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@

![](cover.png){width="80%" fig-align="center"}

![](images/logo-ucsb-office-research.png){width="80%" fig-align="center"}
![](images/delta/delta-logo.png){width="80%" fig-align="center"}

:::

## About the course {.unnumbered}
As part of a collaboration between NCEAS and the Delta Science Program, this course has been adapted from [NCEAS coreR course](https://www.nceas.ucsb.edu/learning-hub/core-r), an in-person immersion in R programming for environmental data science. Researchers will gain experience with essential data science tools and best practices to increase their capacity as collaborators, reproducible coders, and open scientists.

Hosted by the [National Center for Ecological Anlysis and Synthesis (NCEAS)](https://www.nceas.ucsb.edu/) and in partnership with [UCSB's Office of Research](https://www.research.ucsb.edu/), this seminar series is a training program where participants engage in synthesis research in a small cohort. It will equip participants with data science and team science tools, and provide them with a platform to conduct collaborative synthesis research. The overall aim is to grow cross-departmental relationships and interdisciplinary research outputs.

## NCEAS Expertise

NCEAS, a research affiliate of UCSB, is a leading expert on interdisciplinary data science and works collaboratively to answer the world's largest and most complex questions. The NCEAS approach leverages existing data and employs a team science philosophy to squeeze out all potential insights and solutions efficiently - this is called [synthesis science](https://www.nceas.ucsb.edu/our-approach). NCEAS has over 25 years of success with this model among working groups and environmental professionals.
The [National Center for Ecological Analysis and Synthesis (NCEAS)](https://www.nceas.ucsb.edu/), a research affiliate of UCSB, is a leading expert on interdisciplinary data science and works collaboratively to answer the world's largest and most complex questions. The NCEAS approach leverages existing data and employs a team science philosophy to squeeze out all potential insights and solutions efficiently - this is called [synthesis science](https://www.nceas.ucsb.edu/our-approach).

## Week Three: Communicating your Science and Reproducible Workflows
NCEAS has over 25 years of success with this model among working groups and environmental professionals. Together with the Delta Science Program and the Delta Stewardship Council we are excited to pass along skills, workflows, mindsets learn throughout the years.

*March 25 - 27, 2024*

### Learning Objectives
<!-- *June 10 - 13, 2024* -->

- Explore visualization tools such as `ggplot2`, Quarto Dashboards and different packages to plot spatial data.
- Broaden the tool kit of data science analytical tools by exploring text analysis methods and reproducible workflows to access survey data.
- Recap and wrap up the concept of reproducibility and how to apply it into the everyday workflow.
### Learning Objectives
- Effectively manage data using `tidy` data practices
- Implement reproducible scientific workflows throughout all aspects of a project
- Establish best practices and utilize tools like Git & GitHub to optimize your collaboration
- Better communicate scientific analyses and results using Markdown, GitHub webpages, and R packages like `ggplot2` and `Shiny`
- Increase your familiarity and confidence with data science tools

### Week's Schedule

Expand All @@ -43,10 +45,12 @@ These written materials are the result of a continuous and collaborative effort

This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

**Citation:** Camila Vargas Poulsen, Rachel King, Casey O'Hara (2024), UCSB Faculty Seminar Series: Grow Your Data & Team Science Skills, March 25-27, NCEAS Learning Hub. URL <https://learning.nceas.ucsb.edu/2024-03-ucsb-faculty>.
**Citation:** Camila Vargas Poulsen & Angel Chen (2024), NCEAS coreR for Delta Science Program, June 2024, NCEAS Learning Hub. URL <https://learning.nceas.ucsb.edu/2024-06-delta>.

**Additional contributors:** Ben Bolker, Amber E. Budden, Julien Brun, Samantha Csik, Halina Do-Linh, Natasha Haycock-Chavez, S. Jeanette Clark, Julie Lowndes, Stephanie Hampton, Matt Jone, Samanta Katz, Erin McLean, Bryce Mecum, Deanna Pennington, Karthik Ram, Jim Regetz, Tracy Teal, Daphne Virlar-Knight, Leah Wasser.



This is a Quarto book. To learn more about Quarto books visit <https://quarto.org/docs/books>.


Expand Down
18 changes: 9 additions & 9 deletions materials/sections/clean-wrangle-data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Now that we have introduced some data wrangling libraries, let's get the data th

1. Go to [KNB Data Package Alaska commercial salmon catches by management region (1886- 1997)](https://knb.ecoinformatics.org/view/df35b.304.2)

2. Find the data file `byerlySalmonByRegion.csv`. Right click the "Download" button and select "Copy Link Address"
2. Find the data file `df35b.302.1`. Right click the "Download" button and select "Copy Link Address"

3. Paste the copied URL into the `read_csv()` function

Expand Down Expand Up @@ -189,18 +189,19 @@ Before we get too much further, spend a minute or two outlining your Quarto docu
- Clean and Reshape data
- Using `select()` function
- Check column types
- Replace values in a column
- Reshape data
- Replace values in a column with `mutate()`
- Reshape data with `pivot_longer()` and `pivot_wider()`
- Rename columns `rename()`
- Add columns with `mutate()`
- Summary stats using `group_by()` and `summarize()`
- Filtering rows using `filter()`
- Sort data using `arrange()`
- Split and combine values in columns
- Split and combine values in columns with `separate()` and `unite()`

:::

## Data exploration
Similar to what we did in our [Intro to Literate Analysis](https://learning.nceas.ucsb.edu/2023-10-coreR/session_04.html) lesson, it is good practice to skim through the data you just read in.
Similar to what we did in our [Literate Analysis](https://learning.nceas.ucsb.edu/2024-06-delta/session_04.html) lesson, it is good practice to skim through the data you just read in.

Doing so is important to make sure the data is read as you were expecting and to familiarize yourself with the data.

Expand Down Expand Up @@ -340,7 +341,7 @@ It looks like there is only one problem row, lets have a look at it in the origi
catch_data[i,]
```

Well that's odd: The value in `catch_thousands` is the letter `I`. It turns out that this data set is from a PDF which was automatically converted into a `csv` and this value of `I` is actually a 1.
Well that's odd: The value in `Chinook` is the letter `I`. It turns out that this data set is from a PDF which was automatically converted into a `csv` and this value of `I` is actually a 1.

Let's fix it by incorporating the `if_else()` function to our `mutate()` call, which will change the value of the `Chinook` column to 1 if the value is equal to `I`, then will use `as.numeric()` to turn the character representations of numbers into numeric typed values.

Expand Down Expand Up @@ -677,12 +678,11 @@ We just ran through the various things we can do with `dplyr` and `tidyr` but if
```{r}
#| catch: true
#| message: false
catch_original <- read_csv(url("https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1",
method = "libcurl"))
catch_original <- read_csv("https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1")

mean_region <- catch_original %>%
select(-All, -notesRegCode) %>%
mutate(Chinook = ifelse(Chinook == "I", 1, Chinook)) %>%
mutate(Chinook = if_else(Chinook == "I", "1", Chinook)) %>%
mutate(Chinook = as.numeric(Chinook)) %>%
pivot_longer(-c(Region, Year),
names_to = "species",
Expand Down
Loading
Loading