diff --git a/R/GRTSmh.R b/R/GRTSmh.R index 49864e3..22c9a89 100644 --- a/R/GRTSmh.R +++ b/R/GRTSmh.R @@ -332,7 +332,6 @@ read_GRTSmh <- ) ), brick = FALSE) { - if (isTRUE(n2khab_using_raster())) { require_pkgs("raster") read1 <- raster::raster diff --git a/R/options.R b/R/options.R index 5b3b155..3397130 100644 --- a/R/options.R +++ b/R/options.R @@ -70,12 +70,18 @@ n2khab_options <- function() { "n2khab_data_path", tryCatch( n2khab_data_path(), - error = function(e) {message(as.character(e)); NA} + error = function(e) { + message(as.character(e)) + NA + } ), "n2khab_use_raster", tryCatch( n2khab_using_raster(), - error = function(e) {message(as.character(e)); NA} + error = function(e) { + message(as.character(e)) + NA + } ) ) } @@ -121,8 +127,3 @@ n2khab_using_raster <- function() { } opt || grepl("TRUE|true", opt) } - - - - - diff --git a/vignettes/v022_example.Rmd b/vignettes/v022_example.Rmd index f370ec8..dfba593 100644 --- a/vignettes/v022_example.Rmd +++ b/vignettes/v022_example.Rmd @@ -34,8 +34,10 @@ file.copy(source, ".") ### Install and load `n2khab` ```{r} -install.packages("n2khab", repos = c(inbo = "https://inbo.r-universe.dev", - CRAN = "https://cloud.r-project.org")) +install.packages("n2khab", repos = c( + inbo = "https://inbo.r-universe.dev", + CRAN = "https://cloud.r-project.org" +)) ``` ```{r eval=TRUE} diff --git a/vignettes/v030_GRTSmh.Rmd b/vignettes/v030_GRTSmh.Rmd index 02ada9d..d69d58d 100644 --- a/vignettes/v030_GRTSmh.Rmd +++ b/vignettes/v030_GRTSmh.Rmd @@ -70,14 +70,14 @@ See the `vignette("v020_datastorage")` for more information. ```{r} read_GRTSmh() -#> class : SpatRaster +#> class : SpatRaster #> dimensions : 2843, 7401, 1 (nrow, ncol, nlyr) #> resolution : 32, 32 (x, y) #> extent : 22029.59, 258861.6, 153054.1, 244030.1 (xmin, xmax, ymin, ymax) -#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) -#> source : GRTSmaster_habitats.tif -#> name : GRTSmaster_habitats -#> min value : 1 +#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) +#> source : GRTSmaster_habitats.tif +#> name : GRTSmaster_habitats +#> min value : 1 #> max value : 67108857 ``` @@ -86,14 +86,14 @@ With the argument `brick = TRUE` however, you will get the `GRTSmh_brick` data s ```{r} r10 <- read_GRTSmh(brick = TRUE) r10 -#> class : SpatRaster +#> class : SpatRaster #> dimensions : 2843, 7401, 10 (nrow, ncol, nlyr) #> resolution : 32, 32 (x, y) #> extent : 22029.59, 258861.6, 153054.1, 244030.1 (xmin, xmax, ymin, ymax) -#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) -#> source : GRTSmh_brick.tif -#> names : level0, level1, level2, level3, level4, level5, ... -#> min values : 1, 1, 1, 1, 1, 1, ... +#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) +#> source : GRTSmh_brick.tif +#> names : level0, level1, level2, level3, level4, level5, ... +#> min values : 1, 1, 1, 1, 1, 1, ... #> max values : 67108857, 16777209, 4194297, 1048569, 262137, 65529, ... terra::minmax(r10) #> level0 level1 level2 level3 level4 level5 level6 level7 level8 level9 @@ -123,14 +123,14 @@ An example with level 5: ```{r} read_GRTSmh_diffres(level = 5) -#> class : SpatRaster +#> class : SpatRaster #> dimensions : 89, 232, 1 (nrow, ncol, nlyr) #> resolution : 1024, 1024 (x, y) #> extent : 22030, 259598, 153054, 244190 (xmin, xmax, ymin, ymax) -#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) -#> source : GRTSmh_diffres.5.tif -#> name : level5 -#> min value : 1 +#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) +#> source : GRTSmh_diffres.5.tif +#> name : level5 +#> min value : 1 #> max value : 65529 ``` @@ -168,14 +168,14 @@ Its use is just to return the base-4-fraction-converted `GRTSmaster_habitats` as ```{r} options(scipen = 999, digits = 15) read_GRTSmh_base4frac() -#> class : SpatRaster +#> class : SpatRaster #> dimensions : 2843, 7401, 1 (nrow, ncol, nlyr) #> resolution : 32, 32 (x, y) #> extent : 22029.591973471, 258861.591973471, 153054.113583292, 244030.113583292 (xmin, xmax, ymin, ymax) -#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) -#> source : GRTSmh_base4frac.tif -#> name : GRTSmh_base4frac -#> min value : 0.0000000000001 +#> coord. ref. : BD72 / Belgian Lambert 72 (EPSG:31370) +#> source : GRTSmh_base4frac.tif +#> name : GRTSmh_base4frac +#> min value : 0.0000000000001 #> max value : 0.3333333333321 ```