title: Control number of decimal places on xtable output in R
body: <p>I am using Rmd file to create a report and I used xtable package to create the table. The output of the xtable shows the number of decimal places upto 2 digits. Is there a way to control the decimal places in xtable ? </p>
  
  <p>The sample code I used in Rmd file for the xtable is as follows:</p>
  
  <pre><code>```{r, results='asis', message=FALSE, echo=FALSE}
  source("../../R code/data analysis.R")
  library(xtable)
  library(plyr)
  table1 &lt;- xtable(t3,caption="Table showing the Mean discharge and mean gage height on each year on each month",digits=NULL)
  
  print.xtable(table1,type="latex",comment = getOption("xtable.comment", FALSE))
  
  ```
  </code></pre>
  
  <p>The output from this is as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/Qza66.png" alt="enter image description here"></p>
  
  <p>Here, I don't want any decimal places for year and month. Is there a way to control this thing ? </p>
  
  <p>Thanks. </p>