Using functions with several parameters

A function in R can have more than one parameter. In this section, we are going to get acquainted with supplying several arguments to such functions. At the same time, several new functions that take more than one argument will be introduced.

Supplying more than one argument in a function call

When specifying several arguments in a function, we need to assign each argument to the respective parameter using the usual assignment operator = during the function call, separating the assignment expressions for different parameters with commas.

For example, let's examine the seq function. Its most useful three parameters are from, to, and by (you can see in the function's help page that it has several more parameters). ...

Get Learning R for Geospatial Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.