R is self-documenting, meaning all the help you need can be found within the program. This means that there are no excuses for not having help in case your Internet is down!
To get a more interactive version of the help prompt from within your browser, you can use the
This help features allows you to browse through manuals and help pages of packages already installed.
To find help on a particular function, use the
help() function, with the name of the function within the parentheses.
You can also use the question mark symbol as a shortcut.
Without RStudio, the man page will pop up within the console. The controls to navigate this page are simple. Here are the most basic controls to help you get started.
For any special characters, such as the
+ arithmetic function use quotation marks.
> help("+") > ?"+"
Still lost trying to figure out what a function does? That's okay! R also provides examples per function to help you get started.
> example(seq) seq> seq(0, 1, length.out = 11)  0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 seq> seq(stats::rnorm(20)) # effectively 'along'  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 seq> seq(1, 9, by = 2) # matches 'end'  1 3 5 7 9 seq> seq(1, 9, by = pi) # stays below 'end'  1.000000 4.141593 7.283185 ...
Here, we can see examples of the
seq command, which gives sequence variations in numeric sequence.
Let's say you need help solving a system of equations, but are not sure of which function to use. You may search R's available functions based on their descriptions with the
> help.search("solve system of equations") Help files with alias or concept or title matching ‘solve system of equations’ using fuzzy matching: base::solve Solve a System of Equations Type '?PKG::FOO' to inspect entries 'PKG::FOO', or 'TYPE?PKG::FOO' for entries like 'PKG::FOO-TYPE'.
You may also use
?? as a shortcut.
The words before the two colons is the package name (in this case base) that the function comes from.
To run a keyword search, you may use
apropos(). This will look through all functions containing some string.
> apropos("sum") ...  "colSums" "contr.sum"  "cumsum" "format.summaryDefault"  "print.summary.table" "print.summaryDefault"  "rowsum" "rowsum.data.frame"  "rowsum.default" "rowSums"  "sum" "sumAndDouble" ...
Python Playground is a collection of fun programming projects that will inspire you to new heights. You'll manipulate images, build simulations, and interact with hardware using Arduino & Raspberry Pi. With each project, you'll get familiarized with leveraging external libraries for specialized tasks, breaking problems into smaller, solvable pieces, and translating algorithms into code.$ Check price
In this completely revised second edition of the perennial best seller How Linux Works, author Brian Ward makes the concepts behind Linux internals accessible to anyone curious about the inner workings of the operating system. Inside, you'll find the kind of knowledge that normally comes from years of experience doing things the hard way.$ Check price