© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. TollefsonR 4 Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-7924-3_8

8. How to Use a Script or Function

Margot Tollefson1  
(1)
Vanward Statistics, PO Box 286, 612 Teneyck Avenue, Stratford, IA, 50249-0286, USA
 

While scripts are just listings of code stored outside of R, functions are objects of the function mode and are stored in the workspace. Most functions require specific kinds of arguments, which must be input into the function correctly. For example, if a function calls for a matrix and a data frame is input, the function will return an error. Since external tables are often read into the R workspace as data frames, using a data frame for ...

Get R 4 Quick Syntax Reference: A Pocket Guide to the Language, API's and Library 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.