df <- data.frame(lhs = c("a", "b"), rhs = c("c", "d"))
n <- nugget(df,
flavour = "rules",
call_function = "example_function",
call_data = list(ncol = 2,
nrow = 2,
colnames = c("lhs", "rhs")),
call_args = list(data = "mydata"))
inherits(n, "nugget") # TRUE
inherits(n, "rules") # TRUE
attr(n, "call_function") # "dig_example_function"
attr(n, "call_args") # list(data = "mydata")
Run the code above in your browser using DataLab