Skip to content

Commit

Permalink
Try again to resolve CRAN note
Browse files Browse the repository at this point in the history
Examples with CPU time > 2.5 times elapsed time
           user system elapsed ratio
aggregate 2.265  0.048   0.808 2.863
  • Loading branch information
Jean-Romain committed Nov 29, 2022
1 parent 915fc62 commit 0e124f0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 4.0.2
Date: 2022-11-24 16:23:46 UTC
SHA: e9771680aee92e1c4385822b8ca883da45cb336c
Date: 2022-11-28 22:29:13 UTC
SHA: 915fc62f9175031df7b1cc2ef5179d1db7be3df2
31 changes: 16 additions & 15 deletions R/metrics_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
#' fun1 <- ~list(maxz = max(Z))
#' fun2 <- ~list(q85 = quantile(Z, probs = 0.85))
#'
#' set_lidr_threads(1) ; data.table::setDTthreads(1) # for cran only
#'
#' # ================
#' # CLOUD METRICS
#' # ================
Expand All @@ -81,7 +83,7 @@
#' # ================
#'
#' m <- pixel_metrics(las, fun1, 20)
#' plot(m, col = col)
#' #plot(m, col = col)
#'
#' # ================
#' # PLOT METRICS
Expand All @@ -92,16 +94,16 @@
#' inventory # contains an ID and a Value Of Interest (VOI) per plot
#'
#' m <- plot_metrics(las, fun2, inventory, radius = 11.28)
#' plot(header(las))
#' plot(m["q85"], pch = 19, cex = 3, add = TRUE)
#' #plot(header(las))
#' #plot(m["q85"], pch = 19, cex = 3, add = TRUE)
#'
#' \donttest{
#' # Works with polygons as well
#' inventory <- sf::st_buffer(inventory, 11.28)
#' plot(header(las))
#' plot(sf::st_geometry(inventory), add = TRUE)
#' #plot(header(las))
#' #plot(sf::st_geometry(inventory), add = TRUE)
#' m <- plot_metrics(las, .stdmetrics_z, inventory)
#' plot(m["zq85"], pch = 19, cex = 3, add = TRUE)
#' #plot(m["zq85"], pch = 19, cex = 3, add = TRUE)
#' }
#'
#' # ================
Expand All @@ -122,19 +124,18 @@
#' trees <- readLAS(LASfile, filter = "-drop_z_below 0")
#'
#' metrics <- crown_metrics(trees, .stdtreemetrics)
#' plot(metrics["Z"], pch = 19)
#' #plot(metrics["Z"], pch = 19)
#'
#' metrics <- crown_metrics(trees, .stdtreemetrics, geom = "convex")
#' plot(metrics["Z"])
#' #plot(metrics["Z"])
#'
#' metrics <- crown_metrics(trees, .stdtreemetrics, geom = "bbox")
#' plot(metrics["Z"])
#' #plot(metrics["Z"])
#'
#' \donttest{
#' metrics <- crown_metrics(trees, .stdtreemetrics, geom = "concave")
#' plot(metrics["Z"])
#' #plot(metrics["Z"])
#' }
#'
#' # ================
#' # ARGUMENT FILTER
#' # ================
Expand Down Expand Up @@ -162,7 +163,7 @@
#' # func defines one metric but 3 are computed respectively for: (1) all echo types,
#' # (2) for first returns only and (3) for multiple returns only
#' metrics <- pixel_metrics(las, func, 20, by_echo = echo)
#' plot(metrics, col = heat.colors(25))
#' #plot(metrics, col = heat.colors(25))
#'
#' cloud_metrics(las, func, by_echo = echo)
#'
Expand All @@ -175,13 +176,13 @@
#' template <- raster::raster(extent(las), nrow = 15, ncol = 15)
#' raster::crs(template) <- crs(las)
#' m <- template_metrics(las, fun1, template)
#' plot(m, col = col)
#' #plot(m, col = col)
#'
#' # a sfc_POLYGON as template
#' sfc <- sf::st_as_sfc(st_bbox(las))
#' template <- sf::st_make_grid(sfc, cellsize = 20, square = FALSE)
#' m <- template_metrics(las, fun1, template)
#' plot(m)
#' #plot(m)
#'
#' # a bbox as template
#' template <- st_bbox(las) + c(50,30,-50,-70)
Expand All @@ -208,7 +209,7 @@
#' # example with a stars template
#' template <- stars::st_as_stars(st_bbox(las), dx = 10, dy = 10)
#' m <- template_metrics(las, myMetrics(Z, Intensity), template)
#' plot(m, col = col)
#' #plot(m, col = col)
#' }
#' @name aggregate
#' @rdname aggregate
Expand Down
31 changes: 16 additions & 15 deletions man/aggregate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e124f0

Please sign in to comment.