title: How to perform mann kendall trend test on multiple levels
body: <p>I am working with station precipitation data. Each station has precipitation data for 60 years and there are 30 stations. I want to perform a Mann Kendall trend test on each station to see if there is a significant trend for precipitation.</p>
  
  <p>I've tried <code>group_by</code> with <code>summarise</code> to calculate Mann Kendall for each station over the course of 60 years. </p>
  
  <p>Here's a small example where ID is the station and prcp is precipitation. </p>
  
  <pre><code>ID&lt;-c(1,1,1,1,1,2,2,2,2,2)
  prcp&lt;-c(2,0,1,4,5,0,2,3,5,6)
  df&lt;-cbind(ID,prcp)
  
  mk&lt;-df %&gt;%
    as.data.frame() %&gt;% 
    group_by(ID) %&gt;%
    summarise(prcpmk=MannKendall(prcp))
  </code></pre>
  
  <p>Every time I do this I get the following error: <code>Column prcpmk must be length 1 (a summary value), not 5</code></p>
  
  <p>Part of the problem is the the MannKendall function returns 5 values. How can I specify just the p-value when trying to use <code>group_by</code>?</p>
  
  <p>What I want is a df that just has the p-value:</p>
  
  <pre><code>  ID prcpmk
  [1,]  1   0.20
  [2,]  2   0.03
  </code></pre>