library(objectSignals)
My.meta <- setRefClass("My_meta", fields = objectProperties::properties(c(Common.meta,
list(horizontal = "logical", xleft = "numeric"))))
meta <- My.meta$new(alpha = 1)
meta$alpha
meta$xat <- 1:5
meta$pos <- c(1, 4)
meta$horizontal <- FALSE
meta2 <- meta
meta2$xat <- 2:6
meta$xat # meta is changed too
meta$posChanged$connect(function() {
message("the mouse position is (", paste(meta$pos, collapse = ","), ") now")
})
meta$pos <- c(2, 0)
ls(meta) # list all the objects in it
Run the code above in your browser using DataLab