Skip to content

Commit

Permalink
docs: terra examples fix
Browse files Browse the repository at this point in the history
  • Loading branch information
atsyplenkov committed Jan 4, 2025
1 parent f914fe8 commit f84e89d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
10 changes: 6 additions & 4 deletions R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ S7::method(wbw_to_degrees, WhiteboxRaster) <-
#'
#' @seealso [WhiteboxRaster()]
#'
#' @examplesIf requireNamespace("terra", quietly = TRUE)
#' @examples
#' \dontrun{
#' f <- system.file("extdata/dem.tif", package = "wbw")
#' wbw_read_raster(f) |>
#' wbw_slope(units = "r") |>
#' as_rast()
#'
#' }
#' @export
as_rast <-
S7::new_generic(
Expand Down Expand Up @@ -168,12 +169,13 @@ S7::method(as_rast, WhiteboxRaster) <-
#'
#' @seealso [WhiteboxRaster()]
#'
#' @examplesIf requireNamespace("terra", quietly = TRUE)
#' @examples
#' \dontrun{
#' library(terra)
#' f <- system.file("extdata/dem.tif", package = "wbw")
#' rast(f) |>
#' as_wbw_raster()
#'
#' }
#' @export
as_wbw_raster <-
S7::new_generic(
Expand Down
2 changes: 1 addition & 1 deletion R/math.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @return [WhiteboxRaster] object
#'
#' @eval rd_wbw_link("random_sample")
#' @eval rd_example("random_sample", c("num_samples = 100"))
#' @eval rd_example("wbw_random_sample", c("num_samples = 100"))
#'
#' @export
wbw_random_sample <-
Expand Down
6 changes: 2 additions & 4 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
#' @return WhiteboxRaster object
#'
#' @examples
#' \dontrun{
#' raster_path <- system.file("extdata/dem.tif", package = "wbw")
#' wbw_read_raster(raster_path)
#' }
#' f <- system.file("extdata/dem.tif", package = "wbw")
#' wbw_read_raster(f)
#'
#' @export
wbw_read_raster <- function(file_name) {
Expand Down
4 changes: 2 additions & 2 deletions man/as_rast.Rd

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

4 changes: 2 additions & 2 deletions man/as_wbw_raster.Rd

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

6 changes: 2 additions & 4 deletions man/io.Rd

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

2 changes: 1 addition & 1 deletion man/wbw_random_sample.Rd

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

1 comment on commit f84e89d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.