Ops.struct_list | R Documentation |
Binary operations
## S3 method for class 'struct_list'
Ops(e1, e2)
as.double.test = function(x) {
return(x$a)
}
`+.test` = function(e1,e2) {
e1$a = e1$a + as.numeric(e2)
return(e1)
}
x = struct(a=1,b=2,c=1:3,.class="test")
# TODO: needs debugging
# x+3
# x[[1]]+3
# rep(x,5)+1:5
# x[[1]]+x[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.