From 72238a8bdf3160f929f99325d486b630e1424816 Mon Sep 17 00:00:00 2001 From: Naupaka Zimmerman Date: Wed, 13 Mar 2024 09:04:45 -0700 Subject: [PATCH 1/2] Add more context to RStudio project viz setwd, address #144 --- episodes/00-introduction.Rmd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/episodes/00-introduction.Rmd b/episodes/00-introduction.Rmd index d9a1aa0d..e1693605 100644 --- a/episodes/00-introduction.Rmd +++ b/episodes/00-introduction.Rmd @@ -143,6 +143,16 @@ called an **RStudio Project**. An RStudio project allows you to more easily: - Restart work where you left off - Collaborate, especially if you are using version control such as [git](https://swcarpentry.github.io/git-novice/). +Using an RStudio project also has the key benefit of correctly setting your working directory when in an R session. +This is important because R will look for files in the working directory by default. +If you don't set your working directory, you may have to specify the full path (the location on your drive) to a +file every time you want to read or write it. Sometimes people will use `setwd()` to manually +set the working directory for a script, but this is not recommended because this approach requires the working directory to be +set every time you run your script, and can cause problems if you share your script with others or run it on a different machine. +RStudio project directories can be moved to a different location on the computer, or moved to a different computer, and they will +still work correctly because the working directory is set relative to the project directory (it sets the working directory as the directory with +the `.Rproj` file). + 1. To create a project, go to the File menu, and click New Project.... rstudio default session From c3eecbae138c950cf36453d6b56f2a2f9f44c2ce Mon Sep 17 00:00:00 2001 From: Naupaka Zimmerman Date: Wed, 13 Mar 2024 09:17:32 -0700 Subject: [PATCH 2/2] Remove 'mixed' to address #264 --- episodes/00-introduction.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/episodes/00-introduction.Rmd b/episodes/00-introduction.Rmd index 92cd3cfc..bc320629 100644 --- a/episodes/00-introduction.Rmd +++ b/episodes/00-introduction.Rmd @@ -496,7 +496,7 @@ parentheses. - Chi-Squared test - Student t-test -- mixed linear model +- linear model ::::::::::::::: solution @@ -507,7 +507,7 @@ find: - Chi-Squared test: `stats::Chisquare` - Student t-test: `stats::t.test` -- mixed linear model: `stats::lm.glm` +- linear model: `stats::lm.glm`