User Tools

Site Tools


This is an old revision of the document!


Author: David Zelený

The function uses aspect, slope and latitude of the plot and calculates heat load or radiation according to equations published by Keon & McCune (2002).

FIXME First version of the function not completely finished and debugged.

# Function p.adjust.envfit
# Calculates adjusted P values for results stored in envfit object,
# created using envfit function from vegan, which fits supplementary variables
# onto axes of unconstrained ordination. 
# Arguments: 
# aspect - aspect of the plot, vector.
# slope - inclination of the plot, vector.
# latitude - latitude of the plot, either vector of the same length as aspect or slope, or single value (in case that all plots are from the same relatively small region)
# method - default is "heatload", alternative is "radiation".
# units - default id "degrees", alternative is "radians".
# Author: David Zeleny
heatload <- function (aspect, slope, latitude, method = 'heatload', units = 'degrees')
  if (units == 'degrees'){# convert degrees to radians
    aspect <- aspect/180*pi
    slope <- slope/180*pi
    aspect[slope == 0] <- 0
    latitude <- latitude/180*pi
  A <- if (method == 'heatload') abs (pi - abs (aspect - (5*pi/4))) else pi - abs (aspect-pi)
  S <- slope
  L <- if (length (latitude) == 1) rep (latitude, length (A)) else latitude
  eq1 <- exp (-1.467 +1.582*cos(L)*cos(S) -1.500*cos(A)*sin(S)*sin(L) -0.262*sin(A)*sin(S) +0.607*cos(A)*sin(S))
  eq2 <- exp (-1.236 +1.350*cos(L)*cos(S) -1.376*cos(A)*sin(S)*sin(L) -0.331*sin(A)*sin(S) +0.375*cos(A)*sin(S))
  eq3 <-      +0.339 +0.808*cos(L)*cos(S)                             -0.196*sin(A)*sin(S) +                    - 0.482*cos(A)*sin(S)
  return (list (eq1 = eq1, eq2 = eq2, eq3 = eq3))

Example of the use on the dataset grasslands.env (acidophilous grasslands in Trebic region, Czech Republic). The grasslands.env contains variables aspect, slope and latitude, all in degrees. Dataset represents small plots (16-25m2) located on convex outcrops in the agricultural landscape, covered by seminatural grassland vegetation.

source ('') # reads the function definition from above
chem <- read.delim ('', row.names = 1) # reads the ''chem'' dataset
pairs2 (chem[,-15], cex.labels = 1)
en/customized_functions/heatload.1522247297.txt.gz · Last modified: 2018/03/28 22:28 by David Zelený