Impossible to loop with Rmarkdown

Please find here the example :

library(dplyr)
library(nycflights13)
library(kableExtra)

for (indic in names(flights[2:19])) {
  f <- flights %>% select(year, starts_with(indic)) %>% mutate ( INDIC = .[[2]])
  f %>% group_by(year) %>% summarise (NBR = n(), MIN = min(INDIC) , MAX = max(INDIC) , .groups = 'drop') %>% select (year, NBR, MIN , MAX) %>% kbl() %>% kable_styling() -> OUTPUT
  print(OUTPUT)
  }

If I don't create the variable OUTPUT , I can't get any result. When you print this variable you can read HTML code with ## tags before.

How can I get the liste of tables.

Cheers,
Olivier-Denis

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.