props {S7}R Documentation

Get/set multiple properties

Description

Usage

props(object)

props(object) <- value

set_props(object, ...)

Arguments

object

An object from a S7 class

value

A named list of values. The object is checked for validity only after all replacements are performed.

...

Name-value pairs given property to modify and new value.

Value

A named list of property values.

Examples

horse <- new_class("horse", properties = list(
  name = class_character,
  colour = class_character,
  height = class_numeric
))
lexington <- horse(colour = "bay", height = 15, name = "Lex")

props(lexington)
props(lexington) <- list(height = 14, name = "Lexington")
lexington

[Package S7 version 0.1.1 Index]