From 16b7fc3a08dad4b400496d08f2fb67974dc31463 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Thu, 5 Dec 2024 16:19:57 -0500 Subject: [PATCH] Resolve #192 --- modules/Data_Input/Data_Input.Rmd | 19 ++++++++++--------- modules/Data_Input/lab/Data_Input_Lab_Key.Rmd | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/Data_Input/Data_Input.Rmd b/modules/Data_Input/Data_Input.Rmd index 899c1cfd..7bea24d4 100644 --- a/modules/Data_Input/Data_Input.Rmd +++ b/modules/Data_Input/Data_Input.Rmd @@ -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 @@ -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') + +
+
+**delimiters** are symbols that separate cells in a simple-text file. ## Data Input @@ -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. diff --git a/modules/Data_Input/lab/Data_Input_Lab_Key.Rmd b/modules/Data_Input/lab/Data_Input_Lab_Key.Rmd index d3f2c137..201a2e9d 100644 --- a/modules/Data_Input/lab/Data_Input_Lab_Key.Rmd +++ b/modules/Data_Input/lab/Data_Input_Lab_Key.Rmd @@ -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*