Description Usage Arguments Details Functions Examples
View source: R/s5_interpolate_animate.R
Plots the paths between locations for all individuals
in an str_paths or an lc_paths object.
1 2 3 4 5 6 | plot_paths(paths, path_palette = viridis::viridis, add = FALSE,
set_par = !add, use_ggplot = FALSE)
plot.str_paths(stps, ...)
plot.lc_paths(lcps, ...)
|
paths |
An object of class |
path_palette |
A function name that will generate a palette for each
of the individuals tracked. Can be any function that will accept |
add |
|
set_par |
|
use_ggplot |
|
stps |
An object of class |
lcps |
An object of class |
Blah blah
plot.str_paths: Plot str_paths objects
plot.lc_paths: Plot lc_paths objects
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 27 28 29 30 31 32 33 34 35 36 37 38 | #Load sample data
data(acoustic)
#Process detections and stations
proc.det <- proc_dets(det = acoustic$detections, sta = acoustic$stations)
#Calculate COAs -- Note, using 6 hour COAs to reduce processing time
coas.6h <- coa_locs(proc.det, Delta_t = "6 hours")
#Initialize raster
r.cond <- init_raster(study_area = acoustic$study_area, res = 0.001)
#Create conductance raster
conduct <- raster_conduct(sa_rast = r.cond, impassable = acoustic$land)
#Create least-cost paths
lcps <- lc_paths(det_locs = coas.6h, conductance = conduct)
#Plot
plot_paths(lcps)
#Plot on top of detections
#Note set_par = FALSE in both functions
#Consider manually setting graphical parameters for this plot
map_dets(proc_det = proc.det, sta_crs = 4326,
base_layers = list(acoustic$study_area, acoustic$land),
base_cols = list("gray30", "wheat"), base_borders = list(NA, "seagreen"),
xlim=c(-64.636, -64.604), ylim=c(17.770, 17.795),
leg_pos = "topleft", sta_col = "blue", sta_bg = "orange",
set_par = FALSE)
plot_paths(lcps, set_par = FALSE, add = TRUE)
#Plot with ggplot
plot_paths(lcps, use_ggplot = TRUE) +
theme_bw() +
geom_sf(data = acoustic$land)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.