Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# landscapemetrics 2.1.1 #315

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# landscapemetrics 2.1.1
* Improvements
* Simplify roxygen2 docs
* Bugfixes
* Bugfix in calculate of clumpy if NA values are present
* Bugfix in construct_buffer that CRS was lost
Expand Down
3 changes: 0 additions & 3 deletions R/calculate_correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#' metrics <- calculate_lsm(landscape, what = c("patch", "class"))
#' calculate_correlation(metrics, method = "pearson")
#'
#' @aliases calculate_correlation
#' @rdname calculate_correlation
#'
#' @export
calculate_correlation <- function(metrics, method = "pearson",
diag = TRUE, simplify = FALSE) {
Expand Down
3 changes: 0 additions & 3 deletions R/calculate_lsm.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
#' type = "aggregation metric")
#' }
#'
#' @aliases calculate_lsm
#' @rdname calculate_lsm
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/check_landscape.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' check_landscape(c(landscape, landscape))
#'
#' @aliases check_landscape
#' @rdname check_landscape
#'
#' @export
check_landscape <- function(landscape, verbose = TRUE) {

Expand Down
3 changes: 0 additions & 3 deletions R/construct_buffer.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#' coords <- matrix(c(10, 5, 25, 15, 5, 25), ncol = 2, byrow = TRUE)
#' construct_buffer(coords = coords, shape = "square", size = 5)
#'
#' @aliases construct_buffer
#' @rdname construct_buffer
#'
#' @keywords internal
#'
#' @export
Expand Down
3 changes: 0 additions & 3 deletions R/data_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' data_info(landscape)
#'
#' @aliases data_info
#' @rdname data_info
#'
#' @keywords internal
#'
#' @export
Expand Down
3 changes: 0 additions & 3 deletions R/extract_lsm.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
#'
#' }
#'
#' @aliases extract_lsm
#' @rdname extract_lsm
#'
#' @export
extract_lsm <- function(landscape, y,
extract_id = NULL, metric = NULL,
Expand Down
3 changes: 0 additions & 3 deletions R/get_adjacencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
#' 1, NA, 1), 3, 3, byrow = TRUE)
#' get_adjacencies(landscape, diagonal_matrix)
#'
#' @aliases get_adjacencies
#' @rdname get_adjacencies
#'
#' @export
get_adjacencies <- function(landscape, neighbourhood = 4, what = "full", upper = FALSE) {

Expand Down
3 changes: 0 additions & 3 deletions R/get_boundaries.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#' get_boundaries(class_1)
#' get_boundaries(class_1, return_raster = FALSE)
#'
#' @aliases get_boundaries
#' @rdname get_boundaries
#'
#' @export
get_boundaries <- function(landscape,
consider_boundary = FALSE, edge_depth = 1,
Expand Down
3 changes: 0 additions & 3 deletions R/get_centroids.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' get_centroids(landscape)
#'
#' @aliases get_centroids
#' @rdname get_centroids
#'
#' @export
get_centroids <- function(landscape, directions = 8, cell_center = FALSE,
return_vec = FALSE, verbose = TRUE) {
Expand Down
5 changes: 1 addition & 4 deletions R/get_circumscribingcircle.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#' # get circle around whole class
#' get_circumscribingcircle(landscape, level = "class")
#'
#' @aliases get_circumscribingcircle
#' @rdname get_circumscribingcircle
#'
#' @export
get_circumscribingcircle <- function(landscape, directions = 8, level = "patch") {

Expand Down Expand Up @@ -115,7 +112,7 @@ get_circumscribingcircle_calc <- function(landscape, level, directions) {
circle_class <- rcpp_get_circle(landscape, resolution_xy = resolution[1])

# resulting tibble
circle <- tibble::new_tibble(list(level = rep("class", nrow(circle_class)),
circle <- tibble::new_tibble(list(level = rep("class", nrow(circle_class)),
class = as.integer(circle_class$patch_id),
id = rep(as.integer(NA), nrow(circle_class)),
value = circle_class$circle_diameter,
Expand Down
3 changes: 0 additions & 3 deletions R/get_nearestneighbour.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#' get_nearestneighbour(class_1)
#' get_nearestneighbour(class_1, return_id = TRUE)
#'
#' @aliases get_nearestneighbour
#' @rdname get_nearestneighbour
#'
#' @export
get_nearestneighbour <- function(landscape, return_id = FALSE) {

Expand Down
3 changes: 0 additions & 3 deletions R/get_patches.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#' # check for patches of every class
#' patched_raster <- get_patches(landscape)
#'
#' @aliases get_patches
#' @rdname get_patches
#'
#' @export
get_patches <- function(landscape, class = "all", directions = 8,
to_disk = getOption("to_disk", default = FALSE),
Expand Down
3 changes: 0 additions & 3 deletions R/get_unique_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#' landscape_list <- list(landscape, landscape_matrix, x_vec)
#' get_unique_values(landscape_list)
#'
#' @aliases get_unique_values
#' @rdname get_unique_values
#'
#' @export
get_unique_values <- function(x, simplify = FALSE, verbose = TRUE) {

Expand Down
3 changes: 0 additions & 3 deletions R/landscape_as_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' landscape_as_list(c(landscape, landscape))
#'
#' @aliases landscape_as_list
#' @rdname landscape_as_list
#'
#' @export
landscape_as_list <- function(landscape) UseMethod("landscape_as_list")

Expand Down
3 changes: 0 additions & 3 deletions R/list_lsm.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
#' list_lsm(metric = "area", what = c("patch", "lsm_l_ta"))
#' list_lsm(what = c("lsm_c_tca", "lsm_l_ta"))
#'
#' @aliases list_lsm
#' @rdname list_lsm
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_ai.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_ai(landscape)
#'
#' @aliases lsm_c_ai
#' @rdname lsm_c_ai
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_area_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_area_cv(landscape)
#'
#' @aliases lsm_c_area_cv
#' @rdname lsm_c_area_cv
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_area_mn.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_area_mn(landscape)
#'
#' @aliases lsm_c_area_mn
#' @rdname lsm_c_area_mn
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_area_sd.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_area_sd(landscape)
#'
#' @aliases lsm_c_area_sd
#' @rdname lsm_c_area_sd
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_ca.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_ca(landscape)
#'
#' @aliases lsm_c_ca
#' @rdname lsm_c_ca
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_cai_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_cai_cv(landscape)
#'
#' @aliases lsm_c_cai_cv
#' @rdname lsm_c_cai_cv
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_cai_mn.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_cai_mn(landscape)
#'
#' @aliases lsm_c_cai_mn
#' @rdname lsm_c_cai_mn
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_cai_sd.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_cai_sd(landscape)
#'
#' @aliases lsm_c_cai_sd
#' @rdname lsm_c_cai_sd
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_circle_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_circle_cv(landscape)
#'
#' @aliases lsm_c_circle_cv
#' @rdname lsm_c_circle_cv
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_circle_mn.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_circle_mn(landscape)
#'
#' @aliases lsm_c_circle_mn
#' @rdname lsm_c_circle_mn
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_circle_sd.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_circle_sd(landscape)
#'
#' @aliases lsm_c_circle_sd
#' @rdname lsm_c_circle_sd
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_clumpy.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_clumpy(landscape)
#'
#' @aliases lsm_c_clumpy
#' @rdname lsm_c_clumpy
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
5 changes: 1 addition & 4 deletions R/lsm_c_cohesion.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_cohesion(landscape)
#'
#' @aliases lsm_c_cohesion
#' @rdname lsm_c_cohesion
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down Expand Up @@ -87,7 +84,7 @@ lsm_c_cohesion_calc <- function(landscape, directions, resolution, extras = NULL
directions = directions,
resolution = resolution,
extras = extras)

# get number of cells for each patch -> area = n_cells * res / 10000
patch_area$ncells <- patch_area$value * 10000 / prod(resolution)

Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_contig_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_contig_cv(landscape)
#'
#' @aliases lsm_c_contig_cv
#' @rdname lsm_c_contig_cv
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_contig_mn.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_contig_mn(landscape)
#'
#' @aliases lsm_c_contig_mn
#' @rdname lsm_c_contig_mn
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_contig_sd.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_contig_sd(landscape)
#'
#' @aliases lsm_c_contig_sd
#' @rdname lsm_c_contig_sd
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_core_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_core_cv(landscape)
#'
#' @aliases lsm_c_core_cv
#' @rdname lsm_c_core_cv
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_core_mn.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_core_mn(landscape)
#'
#' @aliases lsm_c_core_mn
#' @rdname lsm_c_core_mn
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_core_sd.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_core_sd(landscape)
#'
#' @aliases lsm_c_core_sd
#' @rdname lsm_c_core_sd
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
5 changes: 1 addition & 4 deletions R/lsm_c_cpland.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_cpland(landscape)
#'
#' @aliases lsm_c_cpland
#' @rdname lsm_c_cpland
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down Expand Up @@ -93,7 +90,7 @@ lsm_c_cpland_calc <- function(landscape, directions, consider_boundary, edge_dep
core_area <- lsm_p_core_calc(landscape,
directions = directions,
consider_boundary = consider_boundary,
edge_depth = edge_depth,
edge_depth = edge_depth,
resolution = resolution,
extras = extras)

Expand Down
3 changes: 0 additions & 3 deletions R/lsm_c_dcad.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#' landscape <- terra::rast(landscapemetrics::landscape)
#' lsm_c_dcad(landscape)
#'
#' @aliases lsm_c_dcad
#' @rdname lsm_c_dcad
#'
#' @references
#' McGarigal K., SA Cushman, and E Ene. 2023. FRAGSTATS v4: Spatial Pattern Analysis
#' Program for Categorical Maps. Computer software program produced by the authors;
Expand Down
Loading
Loading