title: Calculating TWI in R?
body: <p>I am trying to calculate a Topographic Wetness Index (TWI) for a DEM in R. </p>
  
  <p>For the TWI, I want to use the upslope.area function in the dynatopmodel package. When running the function I get the following error: "Raster has differing x and y cell resolutions". But when looking at the properties of my raster, the x and y cell size are both 1. Has anybody had a similar problem and found a solution?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>twi &lt;- upslope.area(marion_dem, log-TRUE, atb=TRUE, deg=0.1, fill.sinks=TRUE)
  
  Raster properties:
  class       : RasterLayer 
  dimensions  : 22967, 30492, 700309764  (nrow, ncol, ncell)
  resolution  : 1, 1  (x, y)
  extent      : 41539.28, 72031.28, -5208329, -5185362  (xmin, xmax, ymin, ymax)
  coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 
  data source : D:\Marion GIS\DWH\Marion_DSM.tif 
  names       : Marion_DSM 
  values      : -33, 1248  (min, max)
  </code></pre>