plot.movement_predictions: Plot movement predictions

View source: R/movement.R

plot.movement_predictionsR Documentation

Plot movement predictions

Description

Given a predicted movement model (that is a movement_predictions object), plot the underlying raster, the configured location points and the predicted movements between locations.

Usage

## S3 method for class 'movement_predictions'
plot(x, ...)

Arguments

x

A movement_predictions object

...

Extra parameters to pass to plot

Examples

## Not run: 
# get location data
data(kenya)
kenya10 <- raster::aggregate(kenya, 10, sum)
net <- getNetwork(kenya10, min = 50000)
locationData <- data.frame(location = net$locations,
                           population = net$population,
                           x = net$coordinate[,1],
                           y = net$coordinate[,2])
locationData  <- as.location_dataframe(locationData)
# simulate movements (note the values of movementmatrix must be integer)
predictedMovement  <- predict(radiationWithSelection(theta = 0.5), locationData, symmetric = TRUE)
movementMatrix <- round(predictedMovement$movement_matrix)
# fit a new model to these data
movement_model <- movement(movementMatrix ~ locationData, radiationWithSelection(theta = 0.5))
# predict the population movements
predicted_movements  <- predict(movement_model, kenya10)
# display the predicted movements
plot(predicted_movements)

## End(Not run)

SEEG-Oxford/movement documentation built on April 17, 2023, 4:17 p.m.