title: Repeated measure ANOVA or time series' analysis?
body: <p>I am quite new in R and (I admit it!) not so good with statistics, so I am sorry if my problem is too trivial, but I would really appreciate some hints on the matter. </p>
  
  <p>I have 9 points (plots) of soil humidity measurements for each of the 2 different plantation systems we have (agriforestry and agriculture) over 2 months (weekly measurements). We also have the distance in meters between the closest tree (bigger than 5cm DBH) and the exact measurement point in each of the plots (varying between 4.2 and 12m in Agriforestry and are 50m in agriculture). Therefore, I have a profile of humidity (y) over time (x) (that behave similarly but vary due to weather fluctuations) for each of the 18 plots (9 in agriforestry and 9 in agriculture). What I need to know is:</p>
  
  <ol>
  <li><p>Are these variations in humidity between the measurement points over time dependent on (or influenced by) the distance of the trees? Meaning, do the trees hold more water or take more water from the soil if they are closer to the measurement points (that are in the middle of a plantation?</p></li>
  <li><p>Are these curves (humidity x time) significantly different from each other?</p></li>
  </ol>
  
  <p>I thought first about grouping every 3 points of tree measurements (smaller distances from trees, medium distances and higher distances) for the agriforestry system and all 9 from agroforestry and using them as replications, as they behave more similarly. However it confounded me a bit. </p>
  
  <p>So... I got as far as thinking about using a repeated measure ANOVA from the <code>ez</code> package. So in this case I had:</p>
  
  <pre><code>str(SanPedro)
  
  data.frame':   450 obs. of  6 variables:
   Parcel  : Factor w/ 2 levels "Forest","Agriculture": 1 1 1 1 1 1 1 1 1 1 ...
   Distance: Factor w/ 4 levels "A","B","C","D": 1 1 1 1 1 1 1 1 1 1 ...
   Plot    : num  1 1 1 1 1 1 1 1 1 1 ...
   Date    : Date, format: "0011-07-20" "0011-07-24" ...
   Humidity: num  0.217 0.205 0.199 0.2 0.192 0.181 0.184 0.18 0.179 0.178 ...
   Number  : num  1 2 3 4 5 6 7 8 9 10 ..
  </code></pre>
  
  <p>When I tried to run the <code>ezANOVA</code> as</p>
  
  <pre><code>ezANOVA(data=SanPedro, dv=Humidity, wid=Number, within=Parcel, between=Plot, type=1, return_aov=TRUE)
  </code></pre>
  
  <p>I got this:</p>
  
  <pre><code> Warning: Converting "Number" to factor for ANOVA.
   Warning: "Plot" will be treated as numeric.
   Error in ezANOVA_main(data = data, dv = dv, wid = wid, within = within,  : 
    One or more cells is missing data. Try using ezDesign() to check your data.
  </code></pre>
  
  <p>If I check the <code>ezDesign(SanPedro)</code>, I get:</p>
  
  <pre><code>ezDesign(SanPedro)
  
  Error in as.list(c(x, y, row, col)) : 
   argument "x" is missing, with no default
  </code></pre>
  
  <p>In the end, I do not really understand the problem with the data, and I am not even sure if the <code>ezANOVA</code> is actually the right analysis for my case... I really deeply appreciate any hints and ideas on the matter!!! Thanks a loooot!!! =)</p>