just found this package, really fascinating stuff! I played with it a bit to see if I can integrate it in my scripts (I often have many steps, and having access to previous steps would be great), and it seems there is some bug when using tags together branches. In the MWE I perform some operation, save some number on this operation in a branch, and then continue the pipeline.
library(dplyr)
library(rmonad)
m <- as_monad(as_tibble(iris)) %>% tag('input')%>>%
dplyr::filter(Species == "setosa") %>% tag('filter1') %>^%
nrow %>% tag("nrow") %>>%
dplyr::filter(Sepal.Width > 3) %>% tag("filter2")
However, I haven't found a way to assess the information I saved in the nrow tag: get_value(m, tag = "nrow") and view(m, "nrow") both return the dataset at the filter1 tag. My hunch is that it is related to get_tag(m), since the third node is an empty list:
[[1]]
[[1]][[1]]
[1] "input"
[[2]]
[[2]][[1]]
[1] "filter1"
[[2]][[2]]
[1] "nrow"
[[3]]
list()
[[4]]
[[4]][[1]]
[1] "filter2"
If I add another branch, I get even more empty lists:
m2 <- as_monad(as_tibble(iris)) %>% tag('input')%>>%
dplyr::filter(Species == "setosa") %>% tag('filter1') %>^%
nrow %>% tag("nrow") %>^%
ncol %>% tag("ncol") %>>%
dplyr::filter(Sepal.Width > 3) %>% tag("filter2")
get_tag(m2)
[[1]]
[[1]][[1]]
[1] "input"
[[2]]
[[2]][[1]]
[1] "filter1"
[[2]][[2]]
[1] "nrow"
[[2]][[3]]
[1] "ncol"
[[3]]
list()
[[4]]
list()
[[5]]
[[5]][[1]]
[1] "filter2"
Is it possible to fix this?
just found this package, really fascinating stuff! I played with it a bit to see if I can integrate it in my scripts (I often have many steps, and having access to previous steps would be great), and it seems there is some bug when using tags together branches. In the MWE I perform some operation, save some number on this operation in a branch, and then continue the pipeline.
However, I haven't found a way to assess the information I saved in the
nrowtag:get_value(m, tag = "nrow")andview(m, "nrow")both return the dataset at thefilter1tag. My hunch is that it is related toget_tag(m), since the third node is an empty list:If I add another branch, I get even more empty lists:
Is it possible to fix this?