rsMove (version 0.2.8)

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,
  var.names = NULL
)

Arguments

x

Vector of x coordinates.

y

Vector of y coordinates.

size.var

Optional. Controls the point size.

fill.var

Optional. Controls the fill color.

var.type

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

var.names

Character vector with names for size.var and fill.var to ve added to the plot.

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 e.g. 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
 op <- plotMove(x, y, size.var=et, fill.var=ov, var.type="cont")

}
# }

Run the code above in your browser using DataLab