getOption("help_type")
[1] "text"
Marie-Hélène Burle
In this section, we take our first few steps in R: we will access the R documentation, see how to set R options, and talk about a few concepts.
For some general documentation on R, you can run:
To get help on a function (e.g. sum
), you can run:
Depending on your settings, this will open a documentation for sum
in a pager or in your browser.
Settings are saved in a .Rprofile
file. You can edit the file directly in any text editor or from within R.
List all options:
Return the value of a particular option:
Set an option:
R can accept the equal sign (=
) for assignments, but it is more idiomatic to use the assignment sign (<-
) whenever you bind a name to a value and to use the equal sign everywhere else.
Once you have bound a name to a value, you can recall the value with that name:
You can remove an object from the environment by deleting its name:
Let’s confirm that a
doesn’t exist anymore in the environment:
The garbage collector will take care of deleting the object itself from memory.
Comments
Anything to the left of
#
is a comment and is ignored by R: