kaz-yos / tableone

R package to create "Table 1", description of baseline characteristics with or without propensity score weighting
https://cran.r-project.org/web/packages/tableone/index.html
214 stars 40 forks source link

contDigits =0 #95

Open wstonemd opened 2 years ago

wstonemd commented 2 years ago

Hi Kaz,

Giving contDigits = 0 to the print.TableOne function to render a continuous variable as an integer appears to error out.

> print(tableOne,contDigits = 1)
                      Stratified by trt
                       1               2               p      test
  n                       158             154                     
  time (mean (SD))     2015.6 (1094.1) 1996.9 (1155.9)  0.883     
  ...

> print(tableOne,contDigits = 0)
Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L,  : 
  invalid value 0 for 'digits' argument
kpuka commented 2 years ago

The same issue and error message is also present for "catDigits = 0". This only seems to be a problem in version 0.12.0 or higher (there's no issue in version 0.11.2)

vkerchberger commented 1 year ago

Would love to hear if there has been any progress on this issue.