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 packageError in if
errors, caused by non-logical data or
missing values passed to R’s if
conditional statementError in eval
errors, caused by references to objects
that don’t existcannot open
errors, caused by attempts to read a file
that doesn’t exist or can’t be accessedno applicable method
errors, caused by using an
object-oriented function on a data type it doesn’t supportsubscript out of bounds
errors, caused by trying to
access an element or dimension that doesn’t existStart 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.
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.
If you need help with a specific function, let’s say
barplot()
, you can type:
If you just need to remind yourself of the names of the arguments, you can use:
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
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.
For Fall 22 help is available both in person, and online.
Help
–>
Cheatsheets
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).If you’re a book kinda person, there is plenty of help available as well. Many have online versions or free PDF’s.