Skip to content

Commit

Permalink
Resolve #192
Browse files Browse the repository at this point in the history
  • Loading branch information
avahoffman committed Dec 5, 2024
1 parent 3def2fe commit 16b7fc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions modules/Data_Input/Data_Input.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ R Projects are a super helpful feature of RStudio. They help you:

- **Be more reproducible.** You can share the entire project directory with others, and they can replicate your environment and analysis without much hassle.

## Why projects?

"The chance of the setwd() command having the desired effect – making the file paths work – for anyone besides its author is 0%. It’s also unlikely to work for the author one or two years or computers from now. The project is not self-contained and portable."

- [Jenny Bryan](https://www.tidyverse.org/blog/2017/12/workflow-vs-script/)

**Let's go over how to create and use an R Project!**

## New R Project
Expand Down Expand Up @@ -99,6 +105,10 @@ knitr::include_graphics("images/Data_Input_new_project_topright.png")
* We are going to focus on simple delimited files first
* comma separated (e.g. '.csv')
* tab delimited (e.g. '.txt')

<br>
<br>
**delimiters** are symbols that separate cells in a simple-text file.

## Data Input

Expand Down Expand Up @@ -293,15 +303,6 @@ These functions have slightly different syntax for reading in data (e.g. `header

However, while many online resources use the base R tools, the latest version of RStudio switched to use these new `readr` data import tools, so we will use them in the class for slides. They are also up to two times faster for reading in large datasets, and have a progress bar which is nice.


## TROUBLESHOOTING: Setting the working directory

If you are trying to knit your work, it might help to set the knit directory to the "Current Working Directory":

```{r, fig.alt="Screenshot of the Knit menu, with Knit directory open, and Current Working Directory selected.", out.width = "60%", echo = FALSE, align = "center"}
knitr::include_graphics("images/Data_Input_knit_directory.png")
```

## Other Useful Functions

- The `str()` function can tell you about data/objects.
Expand Down
2 changes: 1 addition & 1 deletion modules/Data_Input/lab/Data_Input_Lab_Key.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Preview the data by examining the Environment. How many observations and variabl

### P.1

Download the data and move the file to your project folder. Import the data by browsing for the file on your computer.
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*
Expand Down

0 comments on commit 16b7fc3

Please sign in to comment.