plot.movement_predictions | R Documentation |
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.
## S3 method for class 'movement_predictions'
plot(x, ...)
x |
A |
... |
Extra parameters to pass to plot |
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.