Skip to content

Commit

Permalink
Apply styler::style_pkg()
Browse files Browse the repository at this point in the history
  • Loading branch information
florisvdh committed Nov 27, 2023
1 parent 51456d4 commit 86d90ed
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
1 change: 0 additions & 1 deletion R/GRTSmh.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ read_GRTSmh <-
)
),
brick = FALSE) {

if (isTRUE(n2khab_using_raster())) {
require_pkgs("raster")
read1 <- raster::raster
Expand Down
15 changes: 8 additions & 7 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
)
}
Expand Down Expand Up @@ -121,8 +127,3 @@ n2khab_using_raster <- function() {
}
opt || grepl("TRUE|true", opt)
}





6 changes: 4 additions & 2 deletions vignettes/v022_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
40 changes: 20 additions & 20 deletions vignettes/v030_GRTSmh.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```

Expand Down

0 comments on commit 86d90ed

Please sign in to comment.