title: Problem with calculating quantile for a number series using data table in R
body: <p>I need to calculate the quantile for a number series in data table R for each row in data table.</p>
  
  <pre><code>Table:  
  
         2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
           NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
         11.7 10.7 10.8 11.8 12.2 13.8  7.0 10.2 11.2  6.8  7.4  9.1  9.5  9.4  9.3 15.6 11.3 13.0 10.9 10.5
           NA   NA  9.5 11.3 16.6 12.2   NA   NA 69.6   NA   NA 12.4 10.8 10.5  8.8  9.9   NA  7.7 12.1   NA
          9.1  8.7 29.9 23.1 18.3 23.5 21.5 23.0 18.2 28.8 39.9 16.4 16.9 23.4 18.8 31.9 26.2 22.4 29.2 25.2
         14.7 17.5 21.1 19.4 20.0 14.5 14.1 12.6  9.9 12.6  6.4  9.6 18.5 14.3 26.2 10.7  6.4  6.9  7.1  9.0
  </code></pre>
  
  <p>I want to calculate quantile for each row of Table above. Please see my code below but I need to place the values for each row as shown in "Output".</p>
  
  <pre><code>year_cols &lt;- c(2000:2019) 
  Table[, c("10","25","50","75","100") := quantile(.SD, na.rm = TRUE, c(0.1,0.25,0.5,0.75,1.0)), .SDcols = as.character(year_cols)]
  </code></pre>
  
  <p>How can I calculate quantile values for each row as shown below or I appreciate if anyone can help to revise my code so that I can show quantile values for each row using data table R.</p>
  
  <pre><code>Output:
  
  2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 10%  25%  50%  75%  100% 
    NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA  NA  NA   NA   NA   NA
  11.7 10.7 10.8 11.8 12.2 13.8  7.0 10.2 11.2  6.8  7.4  9.1  9.5  9.4  9.3 15.6 11.3 13.0 10.9 10.5 7.36 9.37 10.75 11.72 15.60 
    NA   NA  9.5 11.3 16.6 12.2   NA   NA 69.6   NA   NA 12.4 10.8 10.5  8.8  9.9   NA  7.7 12.1   NA
   9.1  8.7 29.9 23.1 18.3 23.5 21.5 23.0 18.2 28.8 39.9 16.4 16.9 23.4 18.8 31.9 26.2 22.4 29.2 25.2
  14.7 17.5 21.1 19.4 20.0 14.5 14.1 12.6  9.9 12.6  6.4  9.6 18.5 14.3 26.2 10.7  6.4  6.9  7.1  9.0
  </code></pre>