Learn R Programming

mlr3misc (version 0.15.1)

get_private: Extract Private Fields of R6 Objects

Description

Provides access to the private members of R6::R6Class objects.

Usage

get_private(x)

Value

environment() of private members, or NULL if x is not an R6 object.

Arguments

x

(any)
Object to extract the private members from.

Examples

Run this code
library(R6)
item = R6Class("Item", private = list(x = 1))$new()
get_private(item)$x

Run the code above in your browser using DataLab