Skip to content

Commit

Permalink
Render site
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 7, 2025
1 parent 60eb290 commit 6506bc7
Show file tree
Hide file tree
Showing 4 changed files with 608 additions and 73 deletions.
8 changes: 4 additions & 4 deletions help.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ <h2><strong>Why are my changes not taking effect? It’s making my results look
<p>Here we are creating a new object from an existing one:</p>
<pre class="r"><code>new_rivers &lt;- sample(rivers, 5)
new_rivers</code></pre>
<pre><code>## [1] 265 1243 545 540 720</code></pre>
<pre><code>## [1] 906 202 652 350 280</code></pre>
<p>Using just this will only print the result and not actually change <code>new_rivers</code>:</p>
<pre class="r"><code>new_rivers + 1</code></pre>
<pre><code>## [1] 266 1244 546 541 721</code></pre>
<pre><code>## [1] 907 203 653 351 281</code></pre>
<p>If we want to modify <code>new_rivers</code> and save that modified version, then we need to reassign <code>new_rivers</code> like so:</p>
<pre class="r"><code>new_rivers &lt;- new_rivers + 1
new_rivers</code></pre>
<pre><code>## [1] 266 1244 546 541 721</code></pre>
<pre><code>## [1] 907 203 653 351 281</code></pre>
<p>If we forget to reassign this can cause subsequent steps to not work as expected because we will not be working with the data that has been modified.</p>
<hr />
</div>
Expand Down Expand Up @@ -403,7 +403,7 @@ <h2><strong>Error: object ‘X’ not found</strong></h2>
<p>Make sure you run something like this, with the <code>&lt;-</code> operator:</p>
<pre class="r"><code>rivers2 &lt;- new_rivers + 1
rivers2</code></pre>
<pre><code>## [1] 267 1245 547 542 722</code></pre>
<pre><code>## [1] 908 204 654 352 282</code></pre>
<hr />
</div>
<div id="error-unexpected-in-error-unexpected-in-error-unexpected-x-in" class="section level2">
Expand Down
196 changes: 127 additions & 69 deletions modules/Data_Input/Data_Input.html

Large diffs are not rendered by default.

126 changes: 126 additions & 0 deletions modules/Data_Input/lab/Data_Input_Lab.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: "Data Input Lab"
output: html_document
editor_options:
chunk_output_type: console
---

# Part 1

## Helpful tips before we start

### TROUBLESHOOTING: Common new user mistakes we have seen

- Check the file path -- is the file there?
- Typos (R is **case sensitive**, `x` and `X` are different)
- Open ended quotes, parentheses, and brackets
- Deleting part of the code chunk
- For any function, you can write `?FUNCTION_NAME`, or `help("FUNCTION_NAME")` to look at the help file

### 1.1

Set up your R Project.

> File, New Project or click the new project button
> New Directory
> New Project
> Type a name and choose a location
> Check that the folder is there!
Check out our resource here: https://daseh.org/resources/R_Projects.html

### 1.2

Load the package by adding "library(tidyverse)" below and running the code.

```{r 1.2response}
```

### 1.3

Use the manual import method (File > Import Dataset > From Text (`readr`)) to read in the CalEnviroScreen data from this URL:

https://daseh.org/data/CalEnviroScreen_data.csv

These data were collected by California Office of Health Hazard Assessment to track environmental measures (like pollution, water contamination, etc.) that can impact human health. You can read more about the project [here](https://calenviroscreen-oehha.hub.arcgis.com/)

### 1.4

What is the dataset object called? You can find this information in the Console or the Environment. Enter your answer as a comment using `#`.

```{r 1.4response}
```

### 1.5

Preview the data by examining the Environment. How many observations and variables are there? Enter your answer as a comment using `#`.

```{r 1.5response}
```

# Practice on Your Own!

### P.1

Download the data from https://daseh.org/data/CalEnviroScreen_data.csv and move the file to your project folder. Import the data by browsing for the file on your computer.

> *Download the data*
> *Put data in the project folder*
> File, Import Dataset, From Text (`readr`)
> browse for the file
> click "Update" and "Import"

# Part 2

### 2.1

Read in the CalEnviroScreen data from this URL using `read_csv` and this URL: https://daseh.org/data/CalEnviroScreen_data.csv. Assign it to an object named `ces`. Use the code structure below.

```
# General format
OBJECT <- read_csv(FILE)
```

```{r 2.1response}
```

### 2.2

Take a look at the data. Do these data objects (`CalEnviroScreen_data` and `ces`) appear to be the same? Why or why not?

```{r 2.2response}
```

### 2.3

Learn your working directory by running `getwd()`. This is where R will look for files unless you tell it otherwise.

```{r 2.3response}
```


# Practice on Your Own!

### P.2

Run the following code - is there a problem? How do you know?

```{r}
ces2 <- read_delim("https://daseh.org/data/CalEnviroScreen_data.csv", delim = "\t")
ces2
```

```{r P.2response}
```

### P.3

Try reading in some data on your computer using any method we discussed!
351 changes: 351 additions & 0 deletions modules/Data_Input/lab/Data_Input_Lab_Key.html

Large diffs are not rendered by default.

0 comments on commit 6506bc7

Please sign in to comment.