I want to use aspect as an independent variable in a multiple regression model but I would like to transform the aspect values so that from degrees 180 to 360, I would get their equivalent to degrees from 0 to 180. How could I do that in ArcGIS or R?
I have several methods available in our Geomorphometry and Gradient Metrics Toolbox (Evans et al., 2014). From your description it sounds like the "Linear Aspect" or "Classify Aspect" tools would work for you. However, I have found that, in regression models, other transformations are much more effective.
The Roberts & Cooper (1989) method unfolds and recenters aspect so that 0 represents north- northeast aspects, (typically the coolest and wettest orientation) and 1 represents hotter, dryer south-southwesterly aspects. The Stage (1976) transformations are an interaction between slope and aspect and have proven to be robust indicators of topographically driven a biotic ecological process. The McCune & Keon (2002) Heat Load Index also represents a slope/aspect interaction but is scaled to represent solar isolation.
The methodology for unfolding or "linearizing" aspect, in ArcGIS raster algebra, are:
tmp1=Aspect(dem) tmp2=SetNull(tmp1 < 0,(450.0 - tmp1) / 57.296) tmp3=Sin(tmp2) tmp4=Cos(tmp2) tmp5=FocalStatistics(tmp3,NbrRectangle(3,3,"CELL"),"SUM","DATA") tmp6=FocalStatistics(tmp4,NbrRectangle(3,3,"CELL"),"SUM","DATA") tmp7 = Mod(((450 - (ATan2(tmp5, tmp6) * 57.296)) * 100), 36000) / 100 outRaster = Con((tmp5 == 0) & (tmp6 == 0),- 1, tmp7)
Evans JS, Oakleaf J, Cushman SA, Theobald D (2014) An ArcGIS Toolbox for Surface Gradient and Geomorphometric Modeling, version 2.0-0. Available: http://evansmurphy.wix.com/evansspatial.
McCune, B. & D. Keon., (2002). Equations for potential annual direct incident radiation and heat load index. Journal of Vegetation Science. 13:603-606.
Stage, A.R., (1976). An Expression of the Effects of Aspect, Slope, and Habitat Type on Tree Growth. Forest Science 22(3):457-460.
Roberts. D.W., and Cooper, S.V., (1989). Concepts and techniques of vegetation mapping. In Land Classifications Based on Vegetation: Applications for Resource Management. USDA Forest Service GTR INT-257, Ogden, UT, pp 90-96