| S7_data | R Documentation |
When an S7 class inherits from an existing base type, it can be useful
to work with the underlying object, i.e. the S7 object stripped of its
S7 class and properties. If the class inherits from an S3 class,
S7_data() preserves the S3 class so the result remains a valid
object of that type.
S7_data(object)
S7_data(object, check = TRUE) <- value
object |
An object from a S7 class |
check |
If |
value |
Object used to replace the underlying data. |
S7_data() returns the data stored in the base object;
S7_data<-() is called for its side-effects and returns object
invisibly.
Text := new_class(parent = class_character)
y <- Text(c(foo = "bar"))
y
S7_data(y)
S7_data(y) <- c("a", "b")
y
# S3 classes are preserved
MyDF := new_class(parent = class_data.frame)
S7_data(MyDF(data.frame(x = 1, y = 2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.