Class 28
Your Data and R Future!
Agenda
Today we’ll focus on:
- Preparing for your data analysis future
- Pause for evaluations/surveys
- hp2 time?
Learning New Languages
If this was your first programming experience, congrats! You’ve made it past those initial hurdles of figuring out how to use code to get your computer to do new stuff!

There are many paths to go from here other than continuing with your R journey. What other languages you might want to learn depends on what you want to do. You should consider your goals first, and try not to spread yourself too thin. If you are planning to stick with linguistic/academic research, you can get quite far with just R. However some languages provide more resources for other kinds of work such as machine learning, web programming, app development, etc.
Each language will have its own community, IDEs, and libraries/packages. Working with other interpreted languages like Python and Javascript are relatively similar to working with R, whereas compiled languages like C, C++, or Java will require learning more about code compilation, system resources, and performance.
To see some comparisons of the actual code for R vs Python in data work, this guide provides a lot of translations.
This whole book has both R and Python code: Computational Analysis of Communication
I share these NOT because I think you should do these things in Python (to the contrary, these are tasks R excels at), but to give an idea of how different programming languages compare. The code itself is usually much more similar than natural languages! For one, they are generally English-based (for better or worse).
The bigger challenge can be getting used to some of the more fundamental differences between languages, even interpreted ones, such as the emphasis on object-oriented programming in Python, and the importance of whitespace. Also working with the ecosystem of libraries is different for each language, and is generally much more difficult for Python than R.
Finding Help
There are many ways to get help with R after class ends from the broader community, and at UM.
UM Resources
- Coderspaces - office hours and Slack
- UM Carpentries
- CSCAR
- MIDAS
- ISR
Beyond UM
The R for Data Science Community has a Slack with help channels and reading groups. Very friendly, highly recommended!
On social media, the biggest R-focused energy is currently on BlueSky. You can search for the hashtag #rstats, and follow related feeds or starter packs. You can use the hashtag to “page” interested folks on questions you have.
There are some R groups on Reddit, though it is not always as friendly (but can be relatively anonymous):
- r/Rlanguage
- r/rstats - more statistics oriented
- r/RStudio - ostensibly about the IDE but many R questions end up here as well
Non-human Code Helpers
We’ve seen that RStudio has various built-in coding tips, like the help system, code completion, and pop-up function tips. However, if you want “bigger” help, you may want to use a tool like GitHub Copilot, an AI-based “pair programmer”. It will give you suggestions for completing your code that are much longer, and make many more assumptions. This can be helpful, but also dangerous - it’s important to understand the code it suggests and adjust it as needed, which is why I didn’t teach this earlier in the semester! It can be helpful for writing tedious sections of code, or reminding you (sometimes correctly) how to do something that you’ve done before.
Copilot is (currently) free for students/educators, and there are instructions for signing up. To enable use of Copilot in RStudio, follow these instructions. You may want to change your settings as instructed on that page to avoid accidentally accepting a lot of irrelevant suggestions from Copilot!
There are also other tools that you can integrate into RStudio such as the {chattr} package (https://mlverse.github.io/chattr/) which gives you an interface to Large Language Models from within RStudio. This would give you a more chat-based AI interface. You need to have access to whatever LLM you want to use with chattr by downloading one locally or having an API access subscription to models like those from OpenAI or UM’s variants.
There were two talks about using these tools at the 2023 posit::conf conference:
Using a local-model is good for anything where you have concerns about data or code privacy - the model runs on your computer and does not pass anything via the internet. Johannes Gruber has made packages including rollama and training materials on using local LLMs through Docker.
Language model interfaces (including ChatGPT, umGPT, Claude, etc.) do not provide any way to extract information - they are not lookup/search interfaces. Never try to retrieve data from an LLM; it may make something up, but it will not be real data!
R Profile and Other Customizations
R profile files can be used to control certain default options for using R on your personal computer. It’s important not to change things that would make your scripts non-reproducible, but it’s useful to customize some features in how your R sessions appear and things like startup messages.

For some fun changes to your startup message, you can follow the guide at Pimp your R startup message.
Do you have your .Rprofile open?
- yes
- no
Here’s another guide to setting up your own custom messages and emojis from Matt Dray: https://www.rostrum.blog/2019/01/04/rprofile-motivate/
You can also easily get and switch between more RStudio themes using the {rsthemes} package (not on CRAN): https://github.com/gadenbuie/rsthemes.
If you want to use a ligature font, you can install (on your computer) and then choose one in RStudio Global Options. I use Victor Mono which is free. Their website also has a tool that shows some other monospace fonts with ligatures (some free, some paid).
You can also try out fonts and colors with your own R code on https://www.programmingfonts.org/#victor-mono.
Improving your R and Reporting Skills
How might you keep up your R skills, or grow new ones?
Regular practice is the best way to really start thinking in R. Here are some R practice ideas:
- complete a current or old Tidy Tuesday, there are new ones each week!
- do a survey using Google Forms and analyze the Google Sheets output using R
- try a new survey tool and use R for analysis
- whenever you have to do some math, open R instead of a calculator!
- use R to create and update Google Sheets whenever you need to use one
- use
{readtext}to extract text from PDFs, etc. - use R and iteration/strings to rename and organize your files and folders
- try some of the cool stuff from Class 25
- convert some of your older code to use custom functions
- checkout new projects on the #rstats tag on BlueSky, Twitter or Mastodon
To expand your reporting and Quarto skills, you could try:
- creating a personal website/portfolio
- using Quarto to create and share slides
- write a term paper in Quarto, including a bibliography
- add more interactivity to your html reports
- learn Shiny!
Cleaning up your GitHub
After class and grading is over, you may want to use your GitHub for your personal projects, webpages, and/or portfolio. You will probably want to transfer over some things from the classroom repositories, and change homework repositories to private.
