Control number of decimal places on xtable output in R Control number of decimal places on xtable output in R r r

Control number of decimal places on xtable output in R


You should use the digits parameter from xtable function correctly.

table1 <- xtable(t3,caption="Table showing the Mean dischargeand mean gage height on each year on each month",digits=c(0,0,0,3,4))

Each element of that vector represents the number of decimal fields in each column (including the first column with row.names).