When running table using Expss package, the variable label gets mixed with each row in the dataframe (tables are output as dataframes). See code below. You will notice that each row label gets prepended with the variable label "Gender" and a bar | character. How to prevent this?
#Required packages
library(magrittr)
require("ggplot2")
library(expss)
#Create dataframe
gen<-c("Male","Male","Female","Female")
data<-data.frame(gen)
names(data)<-"Q1"
#Apply var label
data = apply_labels(data,
Q1 = "Gender")
#Tabulate
tarb<-data %>%
tab_cells(Q1) %>%
tab_stat_cpct() %>%
tab_pivot()
#View table
tarb
#Check what is in the row_labels column - notice gender | prepended
tarb$row_labels