spFastHike: Fast Hiking Method on a spatial domain

Description Usage Arguments Examples

View source: R/FHM.R

Description

This function runs the Fast Hiking Method from sp and raster objects and outputs results in the same formats, making it more convenient for (geo)spatial analyses and simulation. Output arrival time is in hours.

Usage

1
spFastHike(dem, seeds, spatial.res, fun = "Tobler", verbose = T)

Arguments

dem

A raster object of chosen dimension and resolution with elevation data.

seeds

A SpatialPointsDataFrame object containing parameter values for each of the n seeds in its data.frame, in colums named exactly incept (for incept time), off.path, horseback (see Tobler's function). This object will be automatically transformed to the projection of domain.

spatial.res

(Optional) Spatial resolution of the raster in metres. Defaults to that of the raster used.

fun

(Optional) Hiking function to use, See hiking.speed for details.

verbose

(Optional) Boolean to control verbose output.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(raster); library(sp); library(rgdal)
domain <- raster(system.file("external/test.grd", package="raster")) # sample raster
coords <- cbind(c(179000,181200), c(330000, 333000)) # coordinates for seeds
seed.df <- data.frame(Id= c(1,2), incept=c(0,0)) # parameters for each seed
seeds <- SpatialPointsDataFrame(coords, seed.df, proj4string=crs(domain))

fh <- spFastHike(domain, seeds, verbose=FALSE)
par(mfrow=c(1,2), mar=c(1,1,1,3))
plot(domain); contour(fh$arrival.time, levels=seq(0.1,.5,0.2), add=TRUE)
plot(fh$process); contour(fh$arrival.time, levels=seq(0.1,.5,0.2), add=TRUE)

f-silva-archaeo/fastmaRching documentation built on Sept. 6, 2019, 9:13 p.m.