etract each table in pdf

Hello,

I am struggle to export my table into pdf
i have a script with a loop, and I would like to export each table produced by the loop into a pdf file. I don't know which function I can involve in the loop.

I am sharing with you my code , and waiting for your precious help.

Thank you in advance

knitr::opts_chunk$set(echo = FALSE) #le code ne sera pas visible (FALSE)
                                    #valable pour tout le document

library(dplyr)
library(knitr) #Package qu on ajoute pour la mise en forme des résultats
load ("/home/formateur/donnees/depp.Rdata")
for(nat in unique (agents$nature)){
acad_dept <- agents %>% 
filter(agents$nature==nat) %>%
  group_by(acad, dept = substr(etab, 1, 3)) %>% 
  summarise( age_moyen  = mean  (age, na.rm = TRUE),
             age_median = median(age, na.rm = TRUE),
             age_max    = max   (age, na.rm = TRUE),
             nb_agents  = n(),  # compter les lignes
             nb_etab    = n_distinct(etab),
             ratio      = round(nb_agents / nb_etab, 1),
             pct_femmes = sum(sexe == 2, na.rm = TRUE) / 
               nb_agents * 100) %>% 
  ungroup()
}

I would to know how to export into one pdf, and the most important how to export each loop in a singular pdf file

This topic was automatically closed 42 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.