0

I wrote this code to loop through my dataset and generate multiple plots however, the labels of the X axis for all the plots were not informative

for(i in 1:ncol(lfs)) {                     
    print(plot_xtab(
      grp   = lfs$new_worker, 
      x = lfs[ , i],
      xlab= lfs[ , i],
      margin  = "row", 
      bar.pos = "stack",
      show.summary = TRUE,
      coord.flip   = T)
    ) 
}

enter image description here

rnso
  • 23,686
  • 25
  • 112
  • 234
  • What does „not informative“ mean? What have you tried to resolve the problem? – Nico Haase Oct 16 '22 at 07:26
  • I tried using the Paste0(lfs[ , i]) function and it returned an error. I would like to have each returned plot to have x labeled based on that specific variable(i.e x1....Xn) instead of lfs[ , i] that I circled with red ink – Disan Katende Oct 16 '22 at 07:34

0 Answers0