# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Spatial distances
#'
#' @param x matrix with values
#' @param center numeric value (double) with the value of the focal cell
#' @param res numeric value (double) of the spatial resolution of the matrix
#' @return Vector with values the distances between x and center
distances <- function(x, center, res) {
.Call(`_enerscape_distances`, x, center, res)
}
#' Energy Landscape
#'
#' @param slope vector with slopes
#' @param distance vector with distances
#' @param mass body mass of species (kg)
#' @param res numeric value (double) of the spatial resolution of the matrix
#' @param kcal (boolean) if to return the result in kCal (true) or J (false)
#' @return Vector with the energy cost of locomotion (EnergyScape)
energy <- function(slope, distance, mass, res, kcal = TRUE) {
.Call(`_enerscape_energy`, slope, distance, mass, res, kcal)
}
#' Energy Landscape
#'
#' @param x matrix with values the elevation.
#' @param n (integer) number of neighbours to consider (either 4 or 8).
#' @param mass body mass of species (kg).
#' @param res numeric value (double) of the spatial resolution of the matrix.
#' @param kcal (boolean) if to return the result in kCal (true) or J (false).
#' @param out (integer) if to calculate the costs for moving into the cell (0) or from it (1).
#' @param direction (integer) for which direction to calculate costs: 0 for all, 1 for left, 2 for down, 3 for right, 4 for up.
#' @return Matrix with the energy cost of locomotion (EnergyScape).
energyscape <- function(x, n = 4L, mass = 0, res = 0, kcal = TRUE, out = 0L, direction = 0L) {
.Call(`_enerscape_energyscape`, x, n, mass, res, kcal, out, direction)
}
#' Neighbours
#'
#' @param i row index.
#' @param j column index.
#' @param n number of neighbours (4 or 8).
#' @param x matrix with values.
#' @param direction (integer) for which direction to calculate costs: 0 for all, 1 for left, 2 for down, 3 for right, 4 for up.
#' @return Vector with values the neighours of x
neighbours <- function(i, j, n, x, direction) {
.Call(`_enerscape_neighbours`, i, j, n, x, direction)
}
#' Slopes
#'
#' @param x matrix with values
#' @param center numeric value (double) with the value of the focal cell
#' @param res numeric value (double) of the spatial resolution of the matrix
#' @param out (integer) if to calculate the costs for moving into the cell (0) or from it (1).
#' @return Vector with values the slopes (degrees) between x and center
slope <- function(x, center, res, out) {
.Call(`_enerscape_slope`, x, center, res, out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.