Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning RStudio for R Statistical Computing

You're reading from  Learning RStudio for R Statistical Computing

Product type Book
Published in Dec 2012
Publisher Packt
ISBN-13 9781782160601
Pages 126 pages
Edition 1st Edition
Languages
Concepts

Introduction to package writing


In the previous section we saw how you can write a function to be shared with other users. If you want to share a whole bunch of functions with other people, you can consider creating your own R package.

Writing an R extension package has several advantages even if it is not published in a public repository. It allows you to distribute and re-use a set of functions that can be installed on any system that has an R installation. An R package also allows you to hide all sorts of messy functions that are not useful to the user of your package—you can choose which functions are seen by your users and which are not. Functions not seen by the users are for the package's internal use. For example, you could write a function called discriminant(a,b,c), in the example of the previous section that the user of the abc function never needs to be aware of.

Packages have a fairly extensive mandatory documentation system that requires that every parameter of every function...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}