🎯 Welcome to the clubSandwich Internship!
This
comprehensive guide will walk you through everything you need to get
started as a clubSandwich intern. Take your time with each section and
don’t hesitate to reach out for help!
⚡ Quick Start: Make sure you have the latest versions of R and RStudio before proceeding with the rest of this guide.
🔵 R Installation: First and foremost, make sure you have the latest version of R installed:
Whether or not you have R installed, the easiest way is to use this link.
If you would like alternative methods to install/update R, I suggest watching this video.
🔷 RStudio Setup: Similarly, if you will be using RStudio as your IDE, you’ll want the newest version.
If you have RStudio installed, all you have to do is look at the top, click Help, and then click Check for Updates.
If not, install the latest version from here (the same link as the one to install R).
Note: If you would like to use Visual Studio Code with the R extension instead, this should be fine, however, you will have to do some learning on your own, since these instructions are currently tailored to RStudio only.
Updating Packages: Lastly, update your R Packages by copying and pasting this into your console, the text box in the bottom left of RStudio:
update.packages(ask = FALSE, checkBuilt = TRUE)
For this section, please reference Happy Git and Github for the useR. You’ll also want to bookmark this for later.
GitHub Account: If you do not have a GitHub account, skim through chapter 4 and create an account.
Install git: If you do not have git installed, follow the instructions in chapter 6.
Git config: There are a few helpful settings to change when git is first installed. Refer to chapter 7.
(Optional) Git client: In my opinion, this step is very unnecessary, especially if you are already familiar with using git in the command line, and even more so if you have used git in UW-Madison CS/DS courses. RStudio has git’s most commonly used functions built in, so a git client may feel redundant. This being said, because of chapter 8, I tried a few git clients, and I would recommend GitHub Desktop. In a few specific situations, it has saved me a small amount of time over using the command line.
PAT/SSH: Read and follow along with chapter 9 to set up a personal access token, which is what both the book’s author and I recommend. If you have a reason to prefer SSH, refer to chapter 10 instead.
Connect to GitHub: Follow along with chapter 11.
Connecting RStudio and Cloning Practice: Follow
along with chapter 12, but
I suggest naming your repo regexcite
this time (this will
make sense soon) and skipping 12.7.
We are now going to switch over to the book R Packages(2e), which you’ll also want to bookmark.
Setup: Counterintuitively, start with chapter 2 instead of chapter 1. This will take you through the necessary steps to set up your computer for R package development.
Practice Package: now that you’ve gone through all the setup in both books, you’re ready to practice developing a package. Follow along with chapter 1, and take your time. This is going to walk you through your basic workflow and it will be extremely helpful for your own learning. When you reach 1.17, try to use the GitHub repository you made using chapter 12 of Happy Git! If you can successfully figure this out and finish the rest of the chapter, you should be well prepared.
Occasionally, having copilot autocomplete will be quite helpful, and you can give basic prompts in RStudio using comments like such:
## [1] -7 -5 -3 -1 1 3 5 7
GitHub Education: If you do not have GitHub education yet, I suggest first applying for that at https://github.com/education.
Copilot Settings: After doing this, you may want to check your settings at https://github.com/settings/copilot/features. Make sure you’re logged into your GitHub account!
RStudio: In RStudio, click Tools at the top, then Global Options, then Copilot.
You’ll then want to check the enable GitHub Copilot box and log in to your GitHub account.
After this, I suggest that you set Show Copilot Code Suggestions to Manually.
How to Make a Pull Request on GitHub:
💡 Tip: Draft pull requests are useful for sharing work-in-progress and getting early feedback before your code is finalized.
📌 Bookmark These! I recommend that you bookmark all of these page links for future reference, as they will all likely come in handy.
🤖 AI Usage: clubSandwich is open source, and James does not mind generative AI usage as long as you proofread it and let him know where AI was used.
When using AI, remember that context and specificity are extremely important, whether it be for learning or solving a problem.
📖 Manual Files (Help Pages): Using
?function
or ?dataset
in R will usually bring
up a help page that explains most of what you need to know. This is
often faster and more informative than what you’ll find on the internet
or using AI, so if you are confused about something in R, I suggest
using the R manual files before consulting any other resources.
?lm
, we may need to type
?stats::lm
📁 Files within clubSandwich: Similar to the last bullet point, looking at files that already exist in the package will be very helpful for your own learning and as models for your work. James will often point you to files that will be similar to what he is looking to have you do, so asking what files would be similar is always a good question to ask.
👨🏫 James is Here to Help! Building off of the last sentence, James is extremely receptive to questions, especially over email, on github, and during meetings.
📦 clubSandwich development folder on Box: James will share this with you.
I skimmed “Long, Ervin - 2000” before my first day. While it was a bit dense for me at the time, it helped me understand the basic idea of what clubSandwich is for.
This folder also has an older file related to resources I found helpful as well as the Rmd, html, and pdf versions of what you are now reading.
⌨️ F2 Shortcut: When your cursor is within a function and you press F2, RStudio can usually show you the source code for this function. This is especially useful for quickly navigating through clubSandwich files, but it can also be very helpful for understanding other functions that will be interacting with clubSandwich.
lm
, we may need to type
stats::lm
🐛 Debugging Functions: debug()
,
undebug()
, and debugonce()
all take a function
as input.
🤝 Key Principles for Success
🗣️ Communication is Key: Don’t be afraid to reach out, whether it be to James or the OSPO people. Everyone is very friendly and wants to help you, as much as, if not more than most of your TAs and professors for your classes.
⏰ Work Smart, Not Hard: Try to break your work for the week into at least 2 sittings. This is anecdotal, but everyone I know works better when they do things in multiple focused sessions, instead of one excessively long session. When it comes to coding, often times stepping away and giving your eyes and brain a break will work wonders.
📝 Take notes for everything:
📚 Learning is Part of the Job: Remember that learning the requisite information is part of the job. Obviously, the end goal is to write good code, but some weeks you may find that you need to spend most of your time simply learning and understanding in order to do a good job, and that is fine.