Type: Package
Title: Compute Energy Landscapes
Version: 1.2.0
Maintainer: Emilio Berti <emilio.berti@idiv.de>
Description: Compute energy landscapes using a digital elevation model and body mass of animals.
License: GPL-3
Encoding: UTF-8
LazyData: true
Imports: Rcpp, methods, terra
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
LinkingTo: Rcpp
RoxygenNote: 7.3.3
Depends: R (≥ 2.10)
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: yes
Packaged: 2025-09-19 06:53:12 UTC; eb97ziwi
Author: Emilio Berti [aut, cre], Marco Davoli [ctb], Robert Buitenwerf [ctb], Alexander Dyer [ctb], Oskar L.P. Hansen [ctb], Myriam Hirt [ctb], Jens-Christian Svenning [ctb], Joerdis F. Terlau [ctb], Ulrich Brose [ctb], Fritz Vollrath [ctb]
Repository: CRAN
Date/Publication: 2025-09-19 07:20:02 UTC

Create the initialization file for the julia package Circuitscape

Description

This creates the init file for the julia package Circuitscape: https://juliapackages.com/p/circuitscape.

Usage

circuitscape_skeleton(en = NULL, path = NULL, points = NULL)

Arguments

en

an enerscape object.

path

full path where to write the .ini file.

points

data.frame with origin and destination coordinates.

Value

Nothing, only write the circuitscape.ini file to disk.


Spatial distances

Description

Spatial distances

Usage

distances(x, center, res)

Arguments

x

matrix with values

center

numeric value (double) with the value of the focal cell

res

numeric value (double) of the spatial resolution of the matrix

Value

Vector with values the distances between x and center


Energy Landscape

Description

Energy Landscape

Usage

energy(mass, slope, distance, res, kcal)

Arguments

mass

body mass of species (kg)

slope

vector with slopes

distance

vector with distances

res

numeric value (double) of the spatial resolution of the matrix

kcal

(boolean) if to return the result in kCal (true) or J (false)

Value

Vector with the energy cost of locomotion (EnergyScape)


Energy Landscape for walking people

Description

Energy Landscape for walking people

Usage

energyHuman(mass, v, slope, distance, res, kcal)

Arguments

mass

body mass of species (kg)

v

speed

slope

vector with slopes

distance

vector with distances

res

numeric value (double) of the spatial resolution of the matrix

kcal

(boolean) if to return the result in kCal (true) or J (false)

Value

Vector with the energy cost of locomotion (EnergyScape)


Energy Landscape

Description

Energy Landscape

Usage

energyscape(x, mass, n, res, kcal)

Arguments

x

matrix with values the elevation.

mass

body mass of species (kg).

n

(integer) number of neighbours to consider (either 4 or 8).

res

numeric value (double) of the spatial resolution of the matrix.

kcal

(boolean) if to return the result in kCal (true) or J (false).

Value

Matrix with the energy cost of locomotion (EnergyScape).


Energy Landscape

Description

Energy Landscape

Usage

energyscapeHuman(x, mass, v, n, res, kcal)

Arguments

x

matrix with values the elevation.

mass

body mass of species (kg).

v

speed

n

(integer) number of neighbours to consider (either 4 or 8).

res

numeric value (double) of the spatial resolution of the matrix.

kcal

(boolean) if to return the result in kCal (true) or J (false).

Value

Matrix with the energy cost of locomotion (EnergyScape).


Compute Energy Landscapes

Description

This is the main function to compute energy landscapes from a digital elevation model and body mass of animals based on the model from Pontzer (2016).

Usage

enerscape(dem, m, unit = "joule", neigh = 8)

Arguments

dem

raster file of the digital elevation model, either a raster or a full path location of the file.

m

species body mass (kg).

unit

if joules ('joule') or kilocalories ('kcal').

neigh

number of neighbor cells that are connected together.

Value

EnergyScape raster.

References

Pontzer, H. (2016). A unified theory for the energy cost of legged locomotion. Biology Letters, 12(2), 20150935. doi:10.1098/rsbl.2015.0935.

Examples

library(terra)
library(enerscape)

data("volcano")
dem <- rast(volcano)
en <- enerscape(dem, 10, unit = "kcal", neigh = 16)

Compute Energy Landscapes for Walking People

Description

This is the main function to compute energy landscapes from a digital elevation model, body mass of a person, and walking speed from Looney et al. (2019).

Usage

humanscape(dem, m, v = 1.39, unit = "joule", neigh = 8)

Arguments

dem

raster file of the digital elevation model, either a raster or a full path location of the file.

m

species body mass (kg).

v

walking speed (m/s).

unit

if joules ('joule') or kilocalories ('kcal').

neigh

number of neighbor cells that are connected together.

Value

EnergyScape raster.

References

Looney, D. P., Santee, W. R., Hansen, E. O., Bonventre, P. J., Chalmers, C. R., & Potter, A. W. (2019). Estimating energy expenditure during level, uphill, and downhill walking. Med. Sci. Sports Exerc., 51(9), 1954-1960. doi:10.1249/MSS.0000000000002002.

Examples

library(terra)
library(enerscape)

data("volcano")
dem <- rast(volcano)
en <- humanscape(dem, 10, 1, unit = "kcal", neigh = 16)

Neighbours

Description

Neighbours

Usage

neighbours(i, j, n, x)

Arguments

i

row index

j

column index

n

number of neighbours (4 or 8)

x

matrix with values

Value

Vector with values the neighours of x


Create the initialization file for the julia package Omniscape

Description

This creates the init file for the julia package Omniscape: https://juliapackages.com/p/omniscape.

Usage

omniscape_skeleton(en = NULL, path = NULL, radius = NULL, aggr_fact = 1)

Arguments

en

an enerscape object.

path

full path where to write the .ini file.

radius

radius in pixels of the moving window.

aggr_fact

the block size to compute the Omniscape.

Value

Nothing, only write the omniscape.ini file to disk.


Energy cost of transport from Pontzer (2016)

Description

Energy cost of transport from Pontzer (2016)

Usage

pontzer

Format

A data frame with 92 rows and 5 variables:

Species

species name

Incline

incline of movement

Mass

species body mass

Cost.of.Transport

cost of transport

Source

original source of data

Source

doi:10.1098/rsbl.2015.0935

References

#' Pontzer, H. (2016). A unified theory for the energy cost of legged locomotion. Biology Letters, 12(2), 20150935.


Monte Sirente Digital Elevation Model

Description

A matrix with the digital elevation mode of the Monte Sirente (Central Italy).

Usage

sirente

Format

An object of class matrix (inherits from array) with 393 rows and 594 columns.


Slopes

Description

Slopes

Usage

slope(x, center, res)

Arguments

x

matrix with values

center

numeric value (double) with the value of the focal cell

res

numeric value (double) of the spatial resolution of the matrix

Value

Vector with values the slopes (degrees) between x and center


Slopes in radians

Description

Slopes in radians

Usage

slopeRadiant(x, center, res)

Arguments

x

matrix with values

center

numeric value (double) with the value of the focal cell

res

numeric value (double) of the spatial resolution of the matrix

Value

Vector with values the slopes (degrees) between x and center