Search code examples
rfooterquotesflextable

Flextable footer: how to show value between quotes


I am creating an flextable to show some results. To clarify some of the data, and add some data, in the flextable I want to put this in the footer.

I stored the p.value like:

pset1 <- chisq.test(set1)$p.value

And i would like to show the outcome of pset1 in the footer like:

  add_footer(rowname = c("(Waarde) = expected waarde
P-value = [pset1]")) %>% 

The footer within the flextable needs to start with " and needs to end with " in order for it to work. But how can I show the value 'pset1' within this string?


Solution

  • Try

    add_footer(rowname = c(paste0("(Waarde) = expected waarde
    P-value = [", pset1, "]"))) %>%