plot,DeponsShips,missing-method {DEPONS2R}R Documentation

Plot a DeponsShips object

Description

Plot the tracks that ship agents move along in DEPONS.

Usage

## S4 method for signature 'DeponsShips,missing'
plot(x, y, ...)

Arguments

x

DeponsShips object

y

Not used

...

Optional plotting parameters, including 'col', 'main', 'add.legend', and 'legend.xy' (defaults to 'topright' when add.legend=TRUE)

Value

No return value, called for side effects

Examples

data(shipdata)
plot(shipdata, col=c("red", "green", "blue"))


# convert route coordinate units from 'grid squares' to UTM
data(bathymetry)
out <- summary(bathymetry)
left <- out[[4]][1]
bottom <- out[[4]][2]
for (i in 1:3) {
    newroute <- shipdata@routes[[2]][[i]]*400
    newroute$x <- newroute$x + as.numeric(left)
    newroute$y <- newroute$y + as.numeric(bottom)
    shipdata@routes[[2]][[i]] <- newroute
    }

# Reproject coastline and clip to size of Kattegat landscape
library(sp)
data(bathymetry)
data(coastline)
coastline_sf <- sf::st_as_sf(coastline)
coastline2 <- sf::st_transform(coastline_sf, crs(bathymetry))
bbox <- bbox(bathymetry)
clip.poly <- make.clip.poly(bbox, crs(bathymetry))
plot(shipdata, col=c("red", "green", "blue"), add=TRUE, add.legend=TRUE)
plot(clip.poly, add=TRUE)


[Package DEPONS2R version 1.2.2 Index]