R Recipes pp 167-181 | Cite as

Writing Reusable Functions

  • Larry A. Pace


R provides users the ability to write, save, and reuse functions. These functions are flexible and extend the power of R for users who need specialized capabilities not provided by the functions in base R or in contributed packages. Users are advised, however, to check CRAN (the Comprehensive R Archive Network) before they write a function, as it is very likely that someone else has encountered the same problem previously, and has already written the desired function for you. A case in point is the z test function we wrote in Recipe 10-1. As it materializes, the BSDA package already has a function labeled z.test that accomplishes the purpose we needed, and which also provides more options, including two-sample tests and directional and nondirectional alternative hypotheses.


Serum Cholesterol Level Percent Confidence Interval Partial Match Formal Argument Population Standard Deviation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Larry A. Pace 2014

Authors and Affiliations

  • Larry A. Pace
    • 1
  1. 1.SCUnites States

Personalised recommendations