Replies: 2 comments 4 replies
-
Is the idea to treat each row as a group? If so, library(targets)
tar_script({
library(gapminder)
list(
tar_target(data, gapminder),
tar_target(each_row, data, pattern = map(data))
)
})
tar_make(reporter = "silent")
tar_read(each_row, branches = 1)
#> # A tibble: 1 x 6
#> country continent year lifeExp pop gdpPercap
#> <fct> <fct> <int> <dbl> <int> <dbl>
#> 1 Afghanistan Asia 1952 28.8 8425333 779.
tar_read(each_row, branches = 2)
#> # A tibble: 1 x 6
#> country continent year lifeExp pop gdpPercap
#> <fct> <fct> <int> <dbl> <int> <dbl>
#> 1 Afghanistan Asia 1957 30.3 9240934 821. Created on 2021-02-26 by the reprex package (v1.0.0) |
Beta Was this translation helpful? Give feedback.
0 replies
-
thanks! not each row, but per n rows -> 1 group |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wondering whether a function like the following would be helpful to many people. I can create a PR if so...
Beta Was this translation helpful? Give feedback.
All reactions