Skip to content

Commit

Permalink
Import (dont just Suggest) pbapply - see #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Jun 21, 2021
1 parent fd19706 commit eb434d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ RoxygenNote: 7.1.1
Imports:
sf,
raster,
methods
methods,
pbapply
Depends:
R (>= 2.10)
Suggests:
geodist,
pbapply,
terra,
colorspace,
knitr,
Expand Down
6 changes: 1 addition & 5 deletions R/slopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ sequential_dist = function(m, lonlat = TRUE) {
}

slope_matrices = function(m_xyz_split, fun = slope_matrix_weighted, ...) {
if (requireNamespace("pbapply", quietly = TRUE)) {
slope_list = pbapply::pblapply(m_xyz_split, fun, ...)
} else {
slope_list = lapply(m_xyz_split, fun, ...)
}
slope_list = pbapply::pblapply(m_xyz_split, fun, ...)
unlist(slope_list)
}
#' Calculate the gradient of line segments from a raster dataset
Expand Down

0 comments on commit eb434d5

Please sign in to comment.