moveSeg: moveSeg

Description Usage Arguments Details Value See Also Examples

View source: R/moveSeg.R

Description

Pixel based segmentation of movement data using environmental data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
moveSeg(
  x,
  z,
  y,
  data.type = "cont",
  threshold = NULL,
  summary.fun = NULL,
  buffer.size = NULL,
  smooth.fun = NULL
)

Arguments

x

Object of class RasterLayer or data.frame.

z

Object of class Date, POSIXlt or POSIXct.

y

Object of class SpatialPoints or SpatialPointsDataFrame.

data.type

Raster data data.type. One of cont (continuous) or cat (for categorical).

threshold

Change threshold. Required if data.type is set to cat.

summary.fun

Summary function used to summarize the values within each segment when method is cont. Default is mean.

buffer.size

Spatial buffer size applied around each segment (unit depends on spatial projection).

smooth.fun

Smoothing function applied with buffer.size when method is cont. Default is mean.

Details

This function identifies segments of comparable environmental conditions along a movement track given by y. Looking at consecutive data points, the function queries x and proceeds to identify a new segment if threshold is exceeded. Then, for each segment, the function summarizes x using summary.fun and reports on the amount of points found within it. Moreover, if z is set, the function reports on the start and end timestamps and the elapsed time for each segment. If data.type is set as 'cont', the function assumes y is a continuous variable. This will require the user to define threshold which indicates when the difference between consecutive points should be considered as a change. If data.type is set as 'cat', then the function will ignore threshold and map a change every time a change in value occurs. The user might choose to smooth the extracted values using buffer.size. This will prompt the function to summarize the values arounde ach sample in y using a metric define bysmooth.fun. However, if data.type is set to cat, smooth.fun is ignored. In this case, the function will report on the majority value within the spatial buffer. The output of this function consists of:

Value

A list.

See Also

dataQuery imgInt timeDir spaceDir

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{

 require(raster)

 # read raster data
 r <- raster(system.file('extdata', 'landCover.tif', package="rsMove"))

 # read movement data
 data(shortMove)

 # observation time
 z <- strptime(paste0(shortMove@data$date, ' ', shortMove@data$time),
 format="%Y/%m/%d %H:%M:%S")

 # perform directional sampling
 seg <- moveSeg(r, z, shortMove, data.type="cat")

}

RRemelgado/rsMove documentation built on June 7, 2020, 5:12 p.m.