Discrepancy in the `util_classify()` docs
Closed this issue · 1 comments
Nowosad commented
The util_classify()
doc states "The classes start with the value 1. ", but in fact they start from a value of zero:
library(landscapetools)
weight <- c(0.5, 0.25, 0.25)
a = util_classify(fbmmap, weight,
level_names = c("Land Use 1", "Land Use 2", "Land Use 3"))
b = util_classify(fbmmap, weight)
a
#> class : RasterLayer
#> dimensions : 200, 200, 40000 (nrow, ncol, ncell)
#> resolution : 1, 1 (x, y)
#> extent : 0, 200, 0, 200 (xmin, xmax, ymin, ymax)
#> coord. ref. : NA
#> data source : in memory
#> names : layer
#> values : 0, 2 (min, max)
#> attributes :
#> ID Categories
#> 0 Land Use 1
#> 1 Land Use 2
#> 2 Land Use 3
b
#> class : RasterLayer
#> dimensions : 200, 200, 40000 (nrow, ncol, ncell)
#> resolution : 1, 1 (x, y)
#> extent : 0, 200, 0, 200 (xmin, xmax, ymin, ymax)
#> coord. ref. : NA
#> data source : in memory
#> names : layer
#> values : 0, 2 (min, max)
Created on 2018-05-15 by the reprex package (v0.2.0).
Session info
devtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> tz America/New_York
#> date 2018-05-15
#> Packages -----------------------------------------------------------------
#> package * version date
#> backports 1.1.2 2017-12-13
#> base * 3.4.4 2018-03-28
#> checkmate 1.8.5 2017-10-24
#> compiler 3.4.4 2018-03-28
#> datasets * 3.4.4 2018-03-28
#> devtools 1.13.5 2018-02-18
#> digest 0.6.15 2018-01-28
#> evaluate 0.10.1 2017-06-24
#> extrafont 0.17 2014-12-08
#> extrafontdb 1.0 2012-06-11
#> graphics * 3.4.4 2018-03-28
#> grDevices * 3.4.4 2018-03-28
#> grid 3.4.4 2018-03-28
#> htmltools 0.3.6 2017-04-28
#> knitr 1.20 2018-02-20
#> landscapetools * 0.3.0 2018-05-04
#> lattice 0.20-35 2017-03-25
#> magrittr 1.5 2014-11-22
#> memoise 1.1.0 2017-04-21
#> methods * 3.4.4 2018-03-28
#> raster * 2.6-7 2017-11-13
#> Rcpp 0.12.16 2018-03-13
#> rmarkdown 1.9 2018-03-01
#> rprojroot 1.3-2 2018-01-03
#> Rttf2pt1 1.3.6 2018-02-22
#> sp * 1.2-7 2018-01-19
#> stats * 3.4.4 2018-03-28
#> stringi 1.2.2 2018-05-02
#> stringr 1.3.0 2018-02-19
#> tools 3.4.4 2018-03-28
#> utils * 3.4.4 2018-03-28
#> withr 2.1.2 2018-03-17
#> yaml 2.1.18 2018-03-08
#> source
#> CRAN (R 3.4.2)
#> local
#> CRAN (R 3.4.1)
#> local
#> local
#> CRAN (R 3.4.3)
#> cran (@0.6.15)
#> cran (@0.10.1)
#> CRAN (R 3.4.2)
#> CRAN (R 3.4.2)
#> local
#> local
#> local
#> CRAN (R 3.4.0)
#> cran (@1.20)
#> Github (ropensci/landscapetools@eb3ebb8)
#> CRAN (R 3.4.4)
#> CRAN (R 3.4.0)
#> CRAN (R 3.4.0)
#> local
#> cran (@2.6-7)
#> CRAN (R 3.4.3)
#> CRAN (R 3.4.3)
#> CRAN (R 3.4.2)
#> CRAN (R 3.4.3)
#> CRAN (R 3.4.2)
#> local
#> cran (@1.2.2)
#> cran (@1.3.0)
#> local
#> local
#> Github (jimhester/withr@79d7b0d)
#> CRAN (R 3.4.3)
mattfrit commented
Indeed. I fixed it. Thanks for the hint!