What other computers on campus have R?

  • All campus computers should have R & R Studio installed on them.
  • Butte 207 & 211 are open computer labs.
  • Wildcat Lab

Getting started / Installing Programs


Common Error Messages

Taken from: http://blog.revolutionanalytics.com/2015/03/the-most-common-r-error-messages.html

  • could not find function errors, usually caused by typos or not loading a required package
  • Error in if errors, caused by non-logical data or missing values passed to R’s if conditional statement
  • Error in eval errors, caused by references to objects that don’t exist
  • cannot open errors, caused by attempts to read a file that doesn’t exist or can’t be accessed
  • no applicable method errors, caused by using an object-oriented function on a data type it doesn’t support
  • subscript out of bounds errors, caused by trying to access an element or dimension that doesn’t exist
  • package errors caused by being unable to install, compile or load a package.

I get an error message that I don’t understand

Start by googling the error message. However, this doesn’t always work very well because often, package developers rely on the error catching provided by R. You end up with general error messages that might not be very helpful to diagnose a problem (e.g. “subscript out of bounds”). If the message is very generic, you might also include the name of the function or package you’re using in your query.

If you check Stack Overflow, search using the [r] tag. Most questions have already been answered, but the challenge is to use the right words in the search to find the answers: http://stackoverflow.com/questions/tagged/r

⚠️ Development of R moves pretty fast. When at all possible, use results from the past 1-2 years. Anything over 5 years old for packages such as ggplot, dplyr, and forcats are likely obsolete.


Where can I get help using R outside of class time?

Use the built-in RStudio help interface to search for more information on R functions

One of the fastest ways to get help is to use the RStudio help interface. This panel by default can be found at the lower right hand panel of RStudio. As seen in the screenshot, by typing the word mean, RStudio tries to also give a number of suggestions that you might be interested in. The description is then shown in the display window.

I know the name of the function I want to use, but I’m not sure how to use it

If you need help with a specific function, let’s say barplot(), you can type:

?barplot

If you just need to remind yourself of the names of the arguments, you can use:

args(lm)

I want to use a function that does X, there must be a function for it but I don’t know which one…

If you are looking for a function to do a particular task, you can use the help.search() function, which is called by the double question mark ??. However, this only looks through the installed packages for help pages with a match to your search request

??kruskal

If you can’t find what you are looking for, you can use the rdocumentation.org website that searches through the help files across all packages available.

Finally, a generic Google or internet search “R <task>” will often either send you to the appropriate package documentation or a helpful forum where someone else has already asked your question.

From a real live person

For Fall 22 help is available both in person, and online.

  • The person sitting next to you. Don’t hesitate to talk to your neighbor, compare your answers, and ask for help. (as applicable)
  • Your friendly classmates: if you know someone with more experience than you, they might be able and willing to help you.
  • Attend Community Coding.
    • Drop in work session & dedicated space to work on coding projects.
    • Collaborate with your peers and learn from experts.
    • Some hours are held over Zoom
  • The R Users Meetup group useful if you want to stay connected to the community and learn about upcoming events.

Online from people

  • In RStudio go to Help –> Cheatsheets
  • R Studio Cloud interactive lessons: https://rstudio.cloud/learn/primers
  • Stack Overflow: if your question hasn’t been answered before and is well crafted, chances are you will get an answer in less than 5 min. Remember to follow their guidelines on how to ask a good question.
  • Join the discord server.
  • The R-Studio Community: it is read by a lot of people and is more welcoming to new users than the R list-serv.
  • If your question is about a specific package, see if there is a mailing list for it. Usually it’s included in the DESCRIPTION file of the package that can be accessed using packageDescription("name-of-package"). You may also want to try to email the author of the package directly, or open an issue on the code repository (e.g., GitHub).
  • Twitter: #rstats

Written references

If you’re a book kinda person, there is plenty of help available as well. Many have online versions or free PDF’s.

Want to get fancy?


Random blogs