Learn R Programming

rsMove (version 0.2.4)

plotMove: plotMove

Description

Standardized plotting of environmental and temporal information for a set of coordinate pairs.

Usage

plotMove(x, y, size.var = NULL, fill.var = NULL, var.type = NULL)

Arguments

x

Vector of x coordinates.

y

Vector of y coordinates.

size.var

Optional. Vector with elapsed time as report by moveReduce, sampleMove or timeDir. Controls the point size.

fill.var

Optional. Vector with environmental information. Controls the fill color.

var.type

One of 'cont' or 'cat'. Defines the type of fill.var.

Value

A ggplot object.

Details

This function was designed to extent on other functions such as dataQuery, which provides environmental information, and moveReduce, which provides information on the time spent per sample. Using these two functions as an example, plotMove can represent the relation between the elapsed time and the change in environmental conditions.

See Also

dataQuery moveReduce

Examples

Run this code
# NOT RUN {
{

 require(raster)

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

 # read movement data
 data(shortMove)

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

 # reduce amount of samples
 move.reduce <- moveReduce(shortMove, r, time)

 # query data
 ov <- extract(r, move.reduce$points)

 # plot output
 x <- move.reduce$points@data$x
 y <- move.reduce$points@data$y
 et <- move.reduce$points@data$`Elapsed time (minutes)`
 op <- plotMove(x, y, size.var=et, fill.var=ov, var.type="cont")

}
# }

Run the code above in your browser using DataLab