prop | R Documentation |
prop(x, "name")
/ prop@name
get the value of the a property,
erroring if it the property doesn't exist.
prop(x, "name") <- value
/ prop@name <- value
set the value of
a property.
prop(object, name)
prop(object, name, check = TRUE) <- value
object@name
object |
An object from a S7 class |
name |
The name of the parameter as a character. Partial matching is not performed. |
check |
If |
value |
A new value for the property. The object is automatically checked for validity after the replacement is done. |
prop()
and @
return the value of the property.
prop<-()
and @<-
are called for their side-effects and return
the modified object, invisibly.
Horse <- new_class("Horse", properties = list(
name = class_character,
colour = class_character,
height = class_numeric
))
lexington <- Horse(colour = "bay", height = 15, name = "Lex")
lexington@colour
prop(lexington, "colour")
lexington@height <- 14
prop(lexington, "height") <- 15
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.