This lesson is in the early stages of development (Alpha version)

Seeking help

Overview

Teaching: 5 min
Exercises: 0 min
Questions
  • Where can I find help?

Objectives
  • Learn how to use the in-built RStudio help pane

  • Know where to look for answers and how to ask the right questions

What do I do when I need help?

It is inevitable, at some point you will need help. For most people it is impossible to remember every facet of the R language. As such, you will often need to familiarise yourself with the functionality of some aspect of the R language. The help panel built into RStudio is an excellent starting resource.

Head to the console, we will request some help about a function we used in the pre-worksheet. Type:

? getwd()

Note: You may have notice that RStudio is attempting to autocomplete your commands. This can be very useful and efficient but can also lead to you running the wrong commands if you are not paying attention.

/Introduction_to_R/Help%20pane%20showing%20getwd()%20function
Figure 1: Your help pane should now contain this information

Help output

Each function help page is broken down into these sections:

Different functions might have different sections, but these are the core set.

All this information may seem slightly overwhelming now, as you get more familiar with functions you will find this help more useful.

You can also use the help for other aspects, like operators. Write into the console:

? '+'

It seems unlikely that you will need help with a plus operator but there are a whole range of operators that we will encounter that may be less obvious to you.

External help

If you have encountered a problem, often your question has already been answered on Stack Overflow. You can search using the [r] tag. If you can’t find the answer you may want to ask your own, first make sure you have read:

How to ask a good question

Here are a few useful functions to provide the details you may need for asking your question.

Dput will give you an easy to copy and paste output for your data objects.

dput(yourvariable)

SessionInfo will print out your version of R and packages that are currently loaded.

sessionInfo() 

Here we provide some external links providing useful references and cheat sheets for new users of R. Without context they may seem a little daunting but as your knowledge and confidence grows they will become useful references.

R help references

R beginner’s cheat sheets

Key Points

  • You will get stuck at some point, needing help is a case of when not if.

  • Help is available, but it is important you have done your due diligence and are asking for help in the correct places and in the correct format.