rsMove (version 0.2.1)

plotMove: plotMove

Description

Plots per pixel time and value.

Usage

plotMove(x = x, y = y, o.time = NULL, value = NULL, type = NULL)

Arguments

x

Vector of x coordinates.

y

Vector of y coordinates.

o.time

Vector with time length.

value

Vector with environmental data.edata Object of class RasterLayer or data.frame.

type

One of 'cont' or 'cat'. Defines the type of value.

Value

A ggplot object.

Details

This function plots a provided set of x and y coordinates adding information on the elapsed time at each coordinate (e.time) and/or a given environmental variable (value). If only time or value are set, the function builds a scatterplot where the size of the points is defined by the input variables. If both are provided, the size of the points is defined by the elapsed time and the raster value is used to build a color scheme for the points. When value is provided, the keyword type is required. It will influence how the plots are built. The breaks a limits for the point size and colors is define automatically.

See Also

dataQuery moveReduce

Examples

Run this code
# NOT RUN {
{

 require(raster)

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

 # read movement data
 moveData <- read.csv(system.file('extdata', 'konstanz_20130804.csv', package="rsMove"))
 moveData <- SpatialPointsDataFrame(moveData[,1:2], moveData, proj4string=crs(r))

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

 # reduce amount of samples
 move.reduce <- moveReduce(xy=moveData, ot=o.time, img=r)

 # query data
 ov <- dataQuery(xy=move.reduce$points, img=r)

 # plot output
 x <- move.reduce$points@coords[,1]
 y <- move.reduce$points@coords[,2]
 et <- move.reduce$points@data$elapsed.time
 op <- plotMove(x=x, y=y, o.time=et, value=ov[,1], type="cont")

}
# }

Run the code above in your browser using DataCamp Workspace