Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Public and private methods

Methods are functions contained within classes, and in general, they will be either public or private. In general, methods have access to classes' data (which should be encapsulated away from other objects), as well as their public and private methods.

Public methods are visible to other objects and should be as stable as possible since other objects may come to depend on them. If you change them, you may unexpectedly break another object's functionality. Private methods are visible only to the instance itself, which means that other objects cannot (or should not, as is the case with R) call these methods directly. Private methods are allowed to change as often as necessary.

Public methods make use of other methods, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content