© Matt Wiley and Joshua F. Wiley 2020
M. Wiley, J. F. WileyAdvanced R 4 Data Programming and the Cloudhttps://doi.org/10.1007/978-1-4842-5973-3_4

4. Writing Functions

Matt Wiley1  and Joshua F. Wiley2
(1)
Victoria College, Victoria, TX, USA
(2)
Monash University, Melbourne, VIC, Australia
 

Writing your own functions in R enables you to combine a set of R commands into a function that is easy to call and can be generalized. Functions are foundational to R. To become a more advanced user or developer of R, a good understanding of what functions are and how to write them is crucial. Broadly speaking, a function takes one or more inputs and processes them to produce and return output.

Not every programming task should be converted to a function. However, ...

Get Advanced R 4 Data Programming and the Cloud: Using PostgreSQL, AWS, and Shiny 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.