You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the coming project makes heavy use of generated code (exporting the entire workspace to a document), and result block (all blocks but one will depend on the result of a data block): how do we generate code for this?
The text was updated successfully, but these errors were encountered:
I worked on something. In short, we extract the stack name from the result block field value, then extract the corresponding stack from the "reactive" workspace and generate the code from the linked stack:
generate_code.result_block<-function(x) {
if (!is_initialized(x)) {
return(quote(data.frame()))
}
# TBD: value() does not return the expected result. Can't use itval<-x$stack$value# When we initialize the workspace reactive_stack_directory does not exist.#linked_stack<-if (is.null(attr(get_workspace(), "reactive_stack_directory"))) {
get_workspace_stack(val)
} else {
attr(get_workspace(), "reactive_stack_directory")()[[val]]$stack
}
do.call(
bquote,
list(
attr(x, "expr"),
where=list(stack= generate_code(linked_stack)),
splice=FALSE
)
)
}
Given the coming project makes heavy use of generated code (exporting the entire workspace to a document), and result block (all blocks but one will depend on the result of a data block): how do we generate code for this?
The text was updated successfully, but these errors were encountered: