Learn R Programming

Q7 (version 0.1.0)

list2inst: Build a Q7 Object Instance from a List

Description

Build a Q7 Object Instance from a List

Usage

list2inst(x, s3 = "default", parent = parent.frame(), ...)

Arguments

x

list

s3

S3 class name of the instance

parent

parent environment of the instance

...

dot-dot-dot

Value

Q7 object instance

Examples

Run this code
# NOT RUN {
my_data <- list(a = 1,
                add_to_a = function(value){
                  .my$a <- a + value
                })

myDataObject <- list2inst(my_data)

myDataObject$a
myDataObject$add_to_a(20)
myDataObject$a

# }

Run the code above in your browser using DataLab