Time for action - using R's help function

R has a convenient help(...) command that yields overview information about nearly any feature. Let us review this function:

  1. Open R.
  2. Execute the help(...) function without any arguments:
    > #learn more about the help command by using the help(...) function without any arguments
    > help()
    
  3. The R Help window will open to display documentation on the help(...) function.
    Time for action - using R's help function
  4. Execute the help(...) function using the topic argument:
    > #learn more about a specific subject using the help(...) function with a single argument
    > #the argument should specify the name of the subject that you are seeking help on
    > help(library)
    
  5. The R Help window will open to display documentation on the specified topic:
    Time for action - using R's help function

What just happened?

We demonstrated how to use the help(...) function to learn about R components using its built-in documentation system.

help(...)

Our first use of help(...) contained no arguments and therefore conveniently returned documentation on the help(...) function itself. Most often, you will want to use the help(...) function in coordination with a single argument that specifies the subject that you are seeking help on. For instance, we used the help(...) function to learn more about the library(...) function:

> help(library)

Note

Notice that the argument in the help(...) function is simply the name of a topic. As demonstrated, when the topic is a function, no parenthesis, ellipsis, or arguments should be included with the function name.

When executed, the help(...) function opens the R Help window to display the documentation related to the identified subject. The R Help window will display a brief description of the topic along with sections explaining its usage, arguments, details, author(s), references, examples, and related subjects. All of R's help documentation follows this format, although each individual help page may not contain every section.

The help(...) function is a fast and easy way for experienced users to retrieve information. It is best for users who are already familiar with specific R topics and need to be reminded of certain arguments or features. It is not always an optimal tool for learning how to do brand new things, but the built-in help system is the official resource for R documentation.

Pop quiz

  1. What happens when the help() function is executed without any arguments?

    a. It fails to execute and returns an error.

    b. The R Help window displays documentation on the specified subject.

    c. The R Help window displays documentation on the help(...) function.

    d. The R Help window displays a menu of selectable help topics.

  2. What happens when the help(...) function is executed with a subject argument specified?

    a. It fails to execute and returns an error.

    b. The R Help window displays documentation on the specified subject.

    c. The R Help window displays documentation on the help(...) function.

    d. The R Help window displays a menu of selectable help topics.

Have a go hero

Review the help documentation on the chooseCRANmirror(), install.packages(), and library(...) functions to prepare for the next section on packages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.18.65