'R: Is there a way to round to 1 decimal place in table1 for continous variables?

Is there a way to round to 1 decimal place for continuous variables in the table1 package? Looking at the documentation, there seems to be a way to do number of significant figures but there does not seem to be a way to round to 1 decimal place. Here is some example code:

table1(~cyl +disp + hp, data = mtcars)

and here is the output (does 3 significant figures automatically but I can't figure out how to round to a current number of decimal points).

enter image description here

Thanks so much in advance.

r


Solution 1:[1]

add a "digits=" to the table1() function? But it seems the number after "digits=" refers to the total number instead of that after the decimal

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user19049203