library(htmlTable)
library(tidyverse)
library(ggmosaic) for "happy" dataset
I want to create a function that creates frequency tables for all the categorical variables in a dataset and then generate htmlTables for each one. However, by using purrr::map, the tables are in a list. How do I generate the tables using htmlTable? Or any better package that generates similar tables for publication? I suppose I need to split the list or use additional purrr::map functions? Help would be appreciated...
Something like this...
FUN<-function(data){
TAB<-happy%>%select_if(is.factor)%>%
map(table)
TABLES<-htmlTable(TAB)
return(TABLES)
}
