Skip to content
Snippets Groups Projects
Commit f67fc0d5 authored by Ben Anderson's avatar Ben Anderson
Browse files

added functions.R (makeFlextable)

parent 3aa1ef62
Branches
No related tags found
1 merge request!8various fixes to postcode district data
# useful functions
# use source(here::here("R", "functions.R")) to load
require(flextable) # use require so it fails if not present & can't install
makeFlexTable <- function(df, cap = "caption"){
# makes a pretty flextable - see https://cran.r-project.org/web/packages/flextable/index.html
ft <- flextable::flextable(df)
ft <- flextable::colformat_double(ft, digits = 1)
ft <- flextable::fontsize(ft, size = 9)
ft <- flextable::fontsize(ft, size = 10, part = "header")
ft <- flextable::set_caption(ft, caption = cap)
return(flextable::autofit(ft))
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment