I am trying to have a table with numbers (calculated means, actually) and cut them to the second floating figure. For some reason the following code is not working: it gives the table as expected but it does not cut the numbers into it.
Which could be the problem with colformat?
Thank you.
library(readxl)
library(tidyverse)
library(flextable)
library(moments)
library(janitor)
food %>% summarise(lentils=mean(lentils),
eggss=mean(eggs),
fruits=mean(fruits)) %>%
flextable() %>%
fontsize(size=14, part="all") %>%
width(2:3,width=1.5) %>%
colformat_num(digits=2) %>%
set_caption("Mean values")