Created
November 30, 2017 05:04
-
-
Save AliciaSchep/123eb2555129b7f5aadf69ec7ae215c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setClass("DummyClass", | |
slots = c(y = "numeric")) | |
setClass("SpecialClass", | |
slots = c(x = "numeric"), | |
contains = c("DummyClass")) | |
setClass("SpecialList", | |
prototype = list(elementType = "DummyClass"), | |
contains = c("SimpleList")) | |
x <- new("SpecialList") | |
new_special <- new("SpecialClass", y = 3, x = 2) | |
x[["a"]] <- new_special | |
print(new_special) | |
print(x[["a"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment