I am trying to do something similar to what is posted
Could anyone help me with this?
Thanks
CodePudding user response:
Change the imap
to iwalk
cat('## Tabs panel {.tabset} \n')
iris %>%
dplyr::group_split(Species) %>%
purrr::iwalk(.,~{
# create tabset for each group
cat('### Tab',.y,' \n')
p <- ggplot(.x, aes(x = Sepal.Length, y = Sepal.Width)) geom_point()
print(p)
cat('\n')
})
According to ?walk
walk() returns the input .x (invisibly). This makes it easy to use in pipe.