Regarding Creating summary function

I have a data like above, want to create a function like


var1=ensym(var1)
var2=ensym(var2)
label=ensym(label)
  
data %>% tab_cells(mdset(var1 %to% var2,label = !!label))%>% 
tab_cols(banner)%>%   tab_stat_cpct()%>% tab_pivot() %>% flextable ()
}

so that i can apply like this in my chunks

but unable to create it , giving errors

please help to create function

© Copyright 2013-2019 Analytics Vidhya