The analysis.R
code will reproduce the analyses and figures for the research posted currently at bioRxiv. The paper has been provisionally accepted at Nature Ecology & Evolution.
The example.R
code contains a generic example of how the code might be used to calculate the surface descriptors for from any DEM. There are essentially three steps:
- Select the size of the patch for your calculations (
L
) - Select the scales across which fractal dimension will be calculated (
scl
), the smallest scale automatically is the resolution (L0
) - Load a DEM file as
data
(geotif) - Pick the bottom left point of the patch (
x0
andy0
) - Run the
height_variation()
function, which is essentially a wrapper function (seeR/functions.R
). This function only requires the variables mentioned so far (L
,scl
,L0
,data
,x0
andy0
), so make sure there're assigned. The output of theheight_variation()
function is the DEM height range the prescribed scales. For the largest scaleH
(or 2x2m) there is only one value for the entire patch, and the next scale down (1x1m) there are four values, and so on. Best to assign the output to a variable and save it somewhere (see the Example), because the smallest scales are very time-consuming. - Calculate the surface descriptor metrics using the
rdh()
function. This function only requires the output fromheight_variation()
.rdh()
sends back a list with several metrics:
Variable | Description |
---|---|
D | Fractal dimension from model fit |
D_ends | Fractal dimension only considering the largest (L) and smallest (L0) scale |
D_theory | Fractal dimension calculated from theory (i.e., from R and H) |
R | Surface rugosity calculated using surfaceArea function in R |
R_theory | Surface rugosity calculated from theory () |
H | The height range (or height range at L) |
- Apply to uses with 3D mesh
- Look at issues with D when large drop-offs in DEM (can cause D to go below 2)