Skip to content

Jsgro episode 2 draft#23

Closed
jsgro wants to merge 20 commits intocarpentries-incubator:mainfrom
jsgro:jsgro-episode-2-draft
Closed

Jsgro episode 2 draft#23
jsgro wants to merge 20 commits intocarpentries-incubator:mainfrom
jsgro:jsgro-episode-2-draft

Conversation

@jsgro
Copy link

@jsgro jsgro commented Oct 30, 2025

Edited at least the top half of Episode 2 to change from Python to R (.e.g. change .py to R; change VS Code to RStudio).
I have not yet changed the Instructor panels about VS Code.
Other changes:

  • added spacewalks.Rproj to the first series of git add.
  • added -F when using ls to clearly show what is a directory vs a file.
  • added information about specific Mac aspects:
    • explain @ presence in ls -laF command
    • mention .DS_Store
  • offered 2 options to run the code the first time: in RStudio, or using RSCRIPT

Suggestion for next edit: move the creation of .gitignore to this episode as we have at least one dot file due to R: .Rproj.user and Mac users will also have .DS_Store. Also, I noted that when updating the eva_data_analysis.R script .gitignore is created automatically. So we can wait for that to happen, or preempt and create it before running the script.

sstevens2 and others added 9 commits September 30, 2025 09:49
…ce/issue-14

Translate og code python -> R
Made a few change on removing VSCode Terminal.
Update ls output. Add -F. Add ls command to see ".git". Update git status to R file.
Edit section with first commits, and add/edit some explanatory text.
update ls -laF files to match after creating project. Edit more lines.
Update section with filename changes and code change.
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

🆗 Pre-flight checks passed 😃

This pull request has been checked and contains no modified workflow files or spoofing.

It should be safe to Approve and Run the workflows that need maintainer approval.

github-actions bot pushed a commit that referenced this pull request Oct 30, 2025
Revise ls output as sometimes. `.DStore` does not always show up to removed from `ls` and `git` commands.
ADDED a section to add `.gitignore` with `echo` as was done in the Python version (avoids any editor issues.)
I will open an ISSUE about running the code regarding `library(lubridate)`.
github-actions bot pushed a commit that referenced this pull request Oct 30, 2025
jsgro added 3 commits November 4, 2025 13:22
Added a code update moving the `library(lubridate)` one line up so that the code functions. Look at files created. Update git status.
Added a git status and its clean output
fixed challenge and solution close tags with colons ::: etc
github-actions bot pushed a commit that referenced this pull request Nov 4, 2025
@jsgro
Copy link
Author

jsgro commented Nov 6, 2025

(Copy of comment I mistakenly had added to my own branch)
IMPORTANT ADDITION on running the code: R is often run from the RStudio GUI, but to be closer to the Python version and also provide relevant information I provided both RStudio GUI as well as Shell Terminal using RSCRIPT command to run the code.

IMPORTANT ADDITION made to the episode:

  • Once we update the Paths to the files at the top of the R Script there is no suggestion to try if the code now runs (that aspect was also lacking in Python version).
  • However, unlike the Python code, changing the Paths to the files is not enough as the code still has one error (that I think was not intentional) in the sense that the library(lubridate) command has to be one line up and before the line date = Date() since Date() is a function of lubridate. This is also an opportunity to trouble shoot code once more with a different type of error.

IMPORTANT ADDITION: I also moved the .gitignore file creation to this episode as using RStudio will create a .Rproj.user hidden directory, possibly also .Rhistory and on Macs we might see also .DS_Store depending on the order of creation of files/directory etc. This allow to use .gitingnore at this point and get a "clean" slate when checking git status so that we don't have to carry all these Untracked files along to the next episode.

I made these decision along the way as they seemed the best way to approach the changes and differences with the Python version.

Copy link
Contributor

@katrinabrock katrinabrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some early feedback on what you have here thus far.


But which Vignette can help us?

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions:

  • Do we need lubridate here, or can we just use as.Date from base R?
  • ??Date will only work if lubridate is already installed. Can we assume that's the case at this point?

Co-authored-by: Brock <keb266@cornell.edu>
Copy link
Collaborator

@sstevens2 sstevens2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick review of some of the changes needed. I'll start working on implementing the ones I can.

Note, I believe this branch still needs to be rebased to main. I think the only changes are in the episode 2 but it shows multiple files because of the previous rebase of main.

Comment on lines +372 to +375
```bash
$ echo ".Rproj.user" > .gitignore
$ echo ".gitignore" >> .gitignore
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend they build the gitignore themselves and we add a spoiler or callout to mention that github has a generic R gititnore that can be helpful

@sstevens2
Copy link
Collaborator

Closed with preference to #38

@sstevens2 sstevens2 closed this Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants