plotMove: plotMove

Description Usage Arguments Details Value See Also Examples

View source: R/plotMove.R

Description

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

Usage

1
2
3
4
5
6
7
8
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.

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.

Value

A ggplot object.

See Also

dataQuery moveReduce

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{

 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")

}

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