Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions episodes/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ RStudio will then reopen into your project.
Note, now it says `spacewalks` in the upper-right hand corner of RStudio since that project is open and the Files pane is showing the files from the `spacewalks` folder.
When you return to working on this project later, you can click on the `spackewalks.Rproj` file in your file explorer/finder window or you can use the Rproject menu in the upper-right hand side of RStudio to select which projct you would like to work in.

Reproducibility note: For reproducible workflows, it’s best to start each session with a clean environment. Best practice is to turn off workspace saving/loading (Tools → Global Options → General: uncheck “Restore .RData…” and set “Save workspace” to “Never”). If you are prompted to save your workspace when closing RStudio, click "No". This ensures your code runs from a fresh start every time and avoids hidden dependencies on objects left over from previous sessions.

::: instructor
Pause here for some discussion. Are there instances where saving your workspace might be useful? When or why?
:::

You may notice that the software project contains:

1. A JSON file called `data.json` - a snippet of which is shown below - with data on extra-vehicular activities
Expand Down
12 changes: 11 additions & 1 deletion episodes/02-better-start-version-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
The diagram below shows the different parts of a Git repository,
and the most common commands used to work with one.

![Software development lifecycle with Git](fig/ep02_fig05-git-lifecycle.svg){alt='Software development lifecycle with Git diagram showing Git commands and flow of data between components of a Git system, including working directory, staging area, local and remote repository'}

Check warning on line 126 in episodes/02-better-start-version-control.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [Software development lifecycle with Git](fig/ep02_fig05-git-lifecycle.svg)

- **Working directory** - a local directory (including any subdirectories) where your project files live,
and where you are currently working.
Expand Down Expand Up @@ -656,13 +656,23 @@

If we look 2 lines below the error line in `eva_data_analysis.R` , we can note that the line `library(lubridate)` calls a name that matches a Vignette. It seems that the function `Date()` was called before the library was requested.

This is a good reminder that functions from packages must be loaded before use. A common and recommended practice is to load all required libraries at the top of a script to avoid errors and make dependencies clear.

Therefore, the solution is to move `library(lubridate)` at least above the `date=-Date()` code line.
While this should work, it may be judicious to place the `library` command at the top of the script.

Let's edit the file again: place `library(lubridate)` one line above `date = Date()`

Then run the code with either RStudio or `Rscript`. The code should now run its course without error.

::: instructor
It is expected that some learners will not have `lubridate` installed here. They will still get an error when the code is run.
This is a good opportunity to preview and motivate that the next section will teach how to control what is installed with `renv`.

Since this is an intermediate lesson, learners may already be familiar with the difference between `install.packages()` and `library()`. However, this is a good place to briefly review that distinction and ensure everyone has **lubridate** installed so they can proceed.

If `library(lubridate)` throws an error, pause to help learners install it (via `install.packages("lubridate")` or the *Packages* tab). Note that installing a package will also install any required dependencies.
:::

:::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::

Expand Down Expand Up @@ -747,20 +757,20 @@
there is a menu labelled "+" with a dropdown.
Click the dropdown and select "New repository" from the options:

![*Creating a new GitHub repository*](fig/ep02_fig01-create_new_repo.png){alt="Selecting the 'New repository' option from GitHub's dropdown menu labelled '+'" .image-with-shadow }

Check warning on line 760 in episodes/02-better-start-version-control.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [Creating a new GitHub repository](fig/ep02_fig01-create_new_repo.png)

3. You will be presented with some options to fill in or select while creating your repository.
In the "Repository Name" field, type "spacewalks".
This is the name of your project and matches the name of your local folder.

![*Naming the GitHub repository*](fig/ep02_fig02-repository_name.png){alt="Setting the name of the repository on GitHub through the 'Repository Name' text field" .image-with-shadow }

Check warning on line 766 in episodes/02-better-start-version-control.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [Naming the GitHub repository](fig/ep02_fig02-repository_name.png)

Ensure the visibility of the repository is "Public" and leave all other options blank.
Since this repository will be connected to a local repository,
it needs to be empty which is why we chose not to initialise with a README or add a license or `.gitignore` file.
Click "Create repository" at the bottom of the page:

![*Complete GitHub repository creation*](fig/ep02_fig03-create_repository.png){alt="Completing the creation of the GitHub repository by clicking on the 'Create repository' button" .image-with-shadow }

Check warning on line 773 in episodes/02-better-start-version-control.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [Complete GitHub repository creation](fig/ep02_fig03-create_repository.png)

4. Now we have a **remote repository** on GitHub's servers,
you need to send it the files and history from your **local repository**.
Expand All @@ -782,7 +792,7 @@
You can copy these commands using the button that looks like two overlapping squares to the right-hand side of the commands.
Paste them into your terminal and run them.

![*Copy the commands to sync the local and remote repositories*](fig/ep02_fig04-copy_commands.png){alt="Copying the commands to sync the local and remote repositories from the remote repository's home page on GitHub" .image-with-shadow }

Check warning on line 795 in episodes/02-better-start-version-control.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [Copy the commands to sync the local and remote repositories](fig/ep02_fig04-copy_commands.png)

5. If you refresh your browser window,
you should now see the two files `eva_data_analysis.py` and `eva-data.json` visible in the GitHub repository,
Expand Down
Loading