R6 provides encapsulated object-oriented programming for R with reference semantics. It’s a simpler, faster, and lighter-weight alternative to R’s built-in reference classes for classical object-oriented programming.
R6 classes support public and private members, clean inheritance across packages, and don’t depend on S4 or the methods package. This makes them more portable and easier to work with than reference classes. The package offers better performance while maintaining the key benefits of reference semantics for building class-based systems.