Help!

The following are common issues and suggestions for where to get help if you’re stuck.

Common problems

GitHub push errors

It seems that you need to enter your GitHub PAT every time you start a new Posit Cloud session. To set your PAT in R Studio, open any project and type the code below into your R console. Then enter your PAT when prompted.

gitcreds::gitcreds_set()

General tips

R color palettes

How to help yourself

Use R function documentation

The help() function and ? help operator in R provide access to the documentation pages for R functions, data sets, and other objects, both for packages in the standard R distribution and for contributed packages. To access documentation for the standard lm (linear model) function, for example, enter the command help(lm) or help("lm"), or ?lm or ?"lm" (i.e., the quotes are optional).

Each function help page follows the same format. They start with a brief DESCRIPTION of what the package does. The USAGE section shows the various arguments you need to specify when using the function - some will be required, some will be optional. ARGUMENTS very briefly describes each of the arguments that you need to specify. The DETAILS section varies, but the author of the function generally gives more details about the function. VALUE tells you what the outputs of the function will be. EXAMPLES gives you some code snippets to show how the function is used in practice. These are very useful if you’re learning R.

Use the internet

There are internet search sites that are specialized for R searches, including search.r-project.org (which is the site used by RSiteSearch) and Rseek.org. It is also possible to use a general search site like Google, by qualifying the search with “R” or the name of an R package (or both). It can be particularly helpful to paste an error message into a search engine to find out whether others have solved a problem that you encountered.

Other good resources