Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cforgaci committed Sep 13, 2024
1 parent feb2dc8 commit 0905e62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion R/delineate-corridor.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ define_aoi <- function(bb, crs, buffer_dist = 0) {
"Consider using a projected CRS when buffering the AoI.")
}
aoi <- sf::st_buffer(aoi, buffer_dist)
} else aoi
} else {
aoi
}
}

#' Split the area of interest (AoI) by a river.
Expand Down
4 changes: 1 addition & 3 deletions tests/testthat/test-delineate-corridor.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ test_that("given bounding box coordinates and crs, a correct AoI is returned", {
aoi <- define_aoi(bb, crs, buffer_dist = 0)
coords <- sf::st_coordinates(aoi)

bb_expected <- matrix(coords[1:2, 1]) |>
cbind(matrix(coords[2:3, 2])) |> t()
bb_expected <- cbind(matrix(coords[1:2, 1]), matrix(coords[2:3, 2])) |> t()
colnames(bb_expected) <- c("min", "max")
rownames(bb_expected) <- c("x", "y")

Expand All @@ -30,4 +29,3 @@ test_that("splitting an AoI by a river gives two areas of interest", {

expect_equal(length(aoi_split), 2)
})

0 comments on commit 0905e62

Please sign in to comment.