R Reference Class

In this tutorial you will learn about the R Reference Class and its application with practical example.

R Reference Class

Reference class is basically a S4 class with an environment added to it.

Defining a Reference class

In R, reference classes are defined using the setRefClass() function.

Syntax:-

Example:-

Defining reference objects

Reference Methods

In this tutorial we have learn about the R Reference Class and its application with practical example. I hope you will like this tutorial.