feature | R Documentation |
Create an Object Feature
feature(expr)
expr |
expression |
a Q7 feature
Type1 <- type(function(num){}) hasMagic <- feature({ change_number <- function(){ num + 1 } }) myType1 <- Type1(1) %>% hasMagic() myType1$change_number() # Use S3 method dispatch for different behaviors hasMagic <- feature_generic(s3 = "hasMagic") hasMagic.Type1 <- feature({ change_number <- function(){ num + 1 } }) hasMagic.Type2 <- feature({ change_number <- function(){ num - 1 } }) Type1 <- type(function(num){}, s3 = "Type1") %>% hasMagic() Type2 <- type(function(num){}, s3 = "Type2") %>% hasMagic() myType1 <- Type1(1) myType1$change_number() myType2 <- Type2(1) myType2$change_number()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.