Built in plotting function to check automated territory class assignment.
check_auto_terr.Rd
Function plots the automatically generated territory classifications with corresponding ID numbers
take note of the numbers which have been missclassified and correct them using beavertools::user_classify()
Usage
check_auto_terr(
terr_poly,
fill_col = c("#7EAAC7", "#F87223", "#61E265"),
label = TRUE,
basemap = FALSE,
basemap_type = "osmgrayscale",
axes_units = TRUE,
scalebar = TRUE,
scalebar_loc = "tl",
north_arrow = TRUE,
north_arrow_loc = "br",
north_arrow_size = 0.75,
wgs = TRUE,
guide = TRUE,
plot_extent
)
Arguments
- terr_poly
a territory polygon created using
beavertools::estimate_territories()
- fill_col
character vector of R colours or HEX codes.
- label
label activity areas with polygon ID. important when checking the predicted classification
- basemap
Boolean, include an OSM basemap. (optional)
- basemap_type
Character vector for osm map type. for options see
rosm::osm.types()
- axes_units
Boolean to include coordinate values on axis.
- scalebar
Boolean to include a scalebar.
- scalebar_loc
character vector for the scalebar location one of:'tl', 'bl', 'tr', 'br' Meaning "top left" etc.
- north_arrow
Boolean to include a north arrow
- north_arrow_loc
character vector for the arrow location one of:'tl', 'bl', 'tr', 'br' Meaning "top left" etc.
- north_arrow_size
numeric vector for the arrow
- wgs
Boolean to transform coordinate reference system (CRS) to WGS84 (EPSG:4326)
- guide
Boolean to include a legend
- plot_extent
'bbox', 'sf' or 'sp' object defining the desired plot extent.
Examples
# Here we filter the filter the built in 2019-2020 ROBT feeding sign data `RivOtter_FeedSigns`
# Then pipe this 'sf' object to forage_density.
ROBT_201920 <- RivOtter_FeedSigns %>%
dplyr::filter(SurveySeason == "2019 - 2020")%>%
forage_density(., 'FeedCat')
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, will retire in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.
#> The sp package is now running under evolution status 2
#> (status 2 uses the sf package in place of rgdal)
#> No value supplied for "kd_extent" argument: default extent will be used
#> Error in spatialEco::sp.kde(forage_points, y = forage_points$weights, bw = kern_bw, nr = dims$nrows[1], nc = dims$ncols[1], newdata = kd_extent, standardize = standardise): unused arguments (nr = dims$nrows[1], nc = dims$ncols[1], newdata = kd_extent)
# Now we load the ROBT `RivOtter_OtherSigns` dataset and filter to the same
# year as the forage density raster.
CS_201920 <- RivOtter_OtherSigns %>%
dplyr::filter(SurveySeason == "2019 - 2020")
# run territory classification
otter_poly <- estimate_territories(ROBT_201920, confirm_signs = CS_201920)
#> Error in purrr::map(., ~raster::quantile(forage_raster, .)): ℹ In index: 1.
#> Caused by error in `h()`:
#> ! error in evaluating the argument 'x' in selecting a method for function 'quantile': object 'ROBT_201920' not found
# create the map for checking automated territory classification
check_auto_terr(otter_poly, basemap=FALSE, label=TRUE)
#> Error in eval(expr, envir, enclos): object 'otter_poly' not found