dcomtois / summarytools

R Package to Quickly and Neatly Summarize Data
502 stars 77 forks source link

Bug: `print.summarytools` fails printing when `method="pander"` #172

Closed iago-pssjd closed 1 year ago

iago-pssjd commented 1 year ago

Minimal reprex

data("tobacco")
summarytools:::print.summarytools(ctable(tobacco$gender, tobacco$smoker))
Error in sys.calls()[[sys.nframe() - 1]] : 
  attempt to select less than one element in get1index <real>

This is due to https://github.com/dcomtois/summarytools/blob/0615d525b2b64fecb2c0300e4f2af8afa50704d8/R/print.summarytools.R#L240-L249

since sys.nframe() is 1 instead of 2 or greater.