#' @export
construct.function <- function(data, defn, ...) {
data %>%
select(constructor_args(defn)) %>%
transpose() %>%
map(~exec(defn, !!!.))
}
#' @export
deconstruct.function <- function(objs, defn, ...) {
map_dfr(
objs,
function(obj, args) {
map(args, ~obj[[.]]) %>%
set_names(args) %>%
as_tibble_row()
},
args = constructor_args(defn)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.