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
I am seeking to catch pryr::call_tree output, definitely, I failed.
Because I find the call_tree function use cat function to throw output.
I am trying to use pryr::call_tree to analysis the abstract grammar tree to leverage the power of %>% in dplyr to plot the function and data relationship, which is called DAG.
I found %>% have a great nature than other languages, when I am using Airflow, a Python workflow secheduler, the process of describing DAG is so tedious and I think it can be done in R in an elegant way.
In that, I am seeking a way to catch the abstract grammar tree in a list object or two data frame, which called as graph frame, to plot the workflow using ggplot2. And the key problem is how to get the list object...need your help.
>pryr::call_tree
function (x, width = getOption("width"))
{
if (is.expression(x) || is.list(x)) {
trees <- vapply(x, tree, character(1), width = width)
out <- str_c(trees, collapse = "\n\n")
}
else {
out <- tree(x, width = width)
}
cat(out, "\n")
}
<environment: namespace:pryr>
what I am trying
> abc <- function(x) {
+ if (is.expression(x) || is.list(x)) {
+ trees <- vapply(x, tree, character(1), width = width)
+ out <- str_c(trees, collapse = "\n\n")
+ }
+ else {
+ out <- tree(x, width = width)
+ }
+ return(out)
+ }
> abc(123+2123)
Error in abc(123 + 2123) : could not find function "tree"
The text was updated successfully, but these errors were encountered:
I am seeking to catch pryr::call_tree output, definitely, I failed.
Because I find the call_tree function use cat function to throw output.
I am trying to use pryr::call_tree to analysis the abstract grammar tree to leverage the power of %>% in dplyr to plot the function and data relationship, which is called DAG.
I found %>% have a great nature than other languages, when I am using Airflow, a Python workflow secheduler, the process of describing DAG is so tedious and I think it can be done in R in an elegant way.
In that, I am seeking a way to catch the abstract grammar tree in a list object or two data frame, which called as graph frame, to plot the workflow using ggplot2. And the key problem is how to get the list object...need your help.
what I am trying
The text was updated successfully, but these errors were encountered: