If you know the name of the function you’re trying to use, access the help page by:
?
followed by the function name, orhelp()
function:The help page is divided into sections. This format is fairly consistent between different pages and can make it easier to find what you need
If you don’t know the name of the function for what you’re trying to do, you can:
help.search()
??
help.search()
Tip
#| echo: true # Use quotes for topic searches Enclose your search term in double quotes so that R knows it’s a character string (i.e. a normal word or phrase) NOT a function or object name
If you want to search for a multi-word phrase, you must use help.search()
instead of ??
:
Use function help.start()
to open a help browser page. From the page you can access manuals including “An Introduction to R” by the R core development team, references and other material:
Sometimes the same name is used by diverse functions in different packages
When searching for help on a particular function, you can restrict your search to the relevant package by typing the name of the package followed by ::
and then the function name
For example, compare a search for a sort function through all loaded packages, versus only in the reshape
package:
As well as using the help files, we encourage you to carefully read any error messages that arise as you try to run your code
R tries to give you clues about where the errors in your code lie
These clues can sometimes be quite cryptic, but it’s worth reading them to see if you can decipher what they mean, as this will ultimately help you on your journey to become independent and capable coders