12) Use the help() function to explain a function

This Blog entry is from the Getting Started in R section in Learn R.

If using RStudio, navigating to the documentation via the help pane is by far the easiest and most intuitive means to access help.  Taking the output of functions recalled in previous Blog entries,  navigation to help can be triggered by invoking the help function.

To navigate to help,  click on the console input cursor:

all-functions-in-the-ggplot2-package-for-help.png

Type:

help("ggplot")
help-function-in-r-to-get-help-on-ggplot2.png

Press the Enter key to execute the line of script:

ggplot2-help-written-out-to-rstudio-help-window.png

While operating in RStudio,  the help will be displayed in the dedicated help pane.  If operating in the console,  the experience would be that the same text is written out to the console in text only.  It follows that help() exists for the purposes of making help and documentation available universally in R.