Get startedGet started for free

Function documentation

Before even thinking of using an R function, you should clarify which arguments it expects. All the relevant details such as a description, usage, and arguments can be found in the documentation. To consult the documentation on the sample() function, for example, you can use one of following R commands:

help(sample)
?sample

If you execute these commands, you'll be redirected to www.rdocumentation.org.

A quick hack to see the arguments of the sample() function is the args() function. Try it out in the console:

args(sample)

In the next exercises, you'll be learning how to use the mean() function with increasing complexity. The first thing you'll have to do is get acquainted with the mean() function.

This exercise is part of the course

Intermediate R

View Course

Exercise instructions

  • Consult the documentation on the mean() function: ?mean or help(mean).
  • Inspect the arguments of the mean() function using the args() function.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Consult the documentation on the mean() function


# Inspect the arguments of the mean() function
Edit and Run Code