Skip to contents

discretization of variables based on recursive partitioning

Usage

rpart_disc(formula, data, ...)

Arguments

formula

A formula.

data

A data.frame or tibble of observation data.

...

(optional) Other arguments passed to rpart::rpart().

Value

A vector that being discretized.

References

Luo, P., Song, Y., Huang, X., Ma, H., Liu, J., Yao, Y., & Meng, L. (2022). Identifying determinants of spatio-temporal disparities in soil moisture of the Northern Hemisphere using a geographically optimal zones-based heterogeneity model. ISPRS Journal of Photogrammetry and Remote Sensing: Official Publication of the International Society for Photogrammetry and Remote Sensing (ISPRS), 185, 111–128. https://doi.org/10.1016/j.isprsjprs.2022.01.009

Author

Wenbo Lv lyu.geosocial@gmail.com

Examples

data('ndvi')
rpart_disc(NDVIchange ~ ., data = ndvi)
#>   [1] "4"  "4"  "10" "4"  "4"  "4"  "4"  "4"  "10" "10" "10" "10" "4"  "4"  "4" 
#>  [16] "4"  "4"  "6"  "6"  "10" "10" "10" "4"  "4"  "4"  "4"  "4"  "4"  "6"  "10"
#>  [31] "10" "10" "4"  "4"  "4"  "4"  "4"  "4"  "5"  "4"  "6"  "6"  "10" "10" "10"
#>  [46] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "5"  "4"  "4" 
#>  [61] "6"  "10" "10" "10" "10" "13" "12" "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#>  [76] "4"  "4"  "4"  "4"  "4"  "5"  "4"  "4"  "6"  "6"  "10" "10" "10" "12" "12"
#>  [91] "12" "13" "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [106] "4"  "5"  "4"  "4"  "4"  "6"  "10" "10" "11" "11" "11" "12" "12" "12" "4" 
#> [121] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "5"  "5" 
#> [136] "4"  "4"  "6"  "6"  "11" "11" "11" "11" "11" "12" "12" "12" "11" "12" "4" 
#> [151] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "5"  "5" 
#> [166] "5"  "5"  "5"  "6"  "11" "11" "12" "12" "12" "12" "12" "12" "11" "11" "4" 
#> [181] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [196] "4"  "4"  "4"  "5"  "5"  "6"  "11" "11" "11" "11" "11" "12" "12" "11" "11"
#> [211] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [226] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "6"  "6"  "6"  "6"  "6"  "6"  "6"  "6" 
#> [241] "6"  "6"  "6"  "11" "12" "13" "12" "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [256] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [271] "4"  "4"  "6"  "4"  "6"  "6"  "6"  "11" "12" "12" "12" "12" "4"  "4"  "4" 
#> [286] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4" 
#> [301] "4"  "4"  "6"  "6"  "11" "11" "12" "12" "12" "11" "12" "4"  "4"  "4"  "4" 
#> [316] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "4"  "6"  "6"  "11"
#> [331] "12" "12" "12" "12" "12" "12" "11" "11" "12" "12" "11" "4"  "4"  "4"  "4" 
#> [346] "4"  "4"  "4"  "4"  "4"  "4"  "4"  "6"  "6"  "11" "12" "12" "12" "12" "12"
#> [361] "12" "11" "11" "11" "11" "12" "12" "12" "4"  "5"  "4"  "4"  "4"  "4"  "6" 
#> [376] "6"  "6"  "12" "12" "12" "12" "12" "11" "11" "11" "11" "11" "11" "12" "12"
#> [391] "12" "12" "4"  "4"  "4"  "4"  "4"  "6"  "6"  "6"  "11" "12" "12" "12" "12"
#> [406] "12" "12" "11" "11" "11" "11" "11" "11" "12" "12" "13" "4"  "4"  "4"  "4" 
#> [421] "4"  "4"  "6"  "6"  "6"  "11" "12" "12" "12" "12" "12" "12" "11" "11" "11"
#> [436] "11" "11" "11" "12" "12" "4"  "4"  "4"  "4"  "4"  "4"  "6"  "6"  "6"  "6" 
#> [451] "11" "12" "12" "12" "13" "12" "12" "11" "11" "11" "11" "11" "12" "12" "4" 
#> [466] "6"  "6"  "6"  "6"  "6"  "12" "12" "12" "12" "13" "13" "12" "12" "12" "11"
#> [481] "11" "11" "12" "6"  "12" "6"  "6"  "11" "11" "12" "12" "12" "13" "13" "13"
#> [496] "12" "12" "12" "6"  "11" "12" "11" "12" "12" "13" "13" "13" "13" "12" "12"
#> [511] "6"  "11" "12" "12" "12" "12" "13" "13" "13" "13" "13" "12" "11" "12" "12"
#> [526] "12" "13" "13" "13" "13" "13" "13" "12" "12" "13" "13" "13" "13" "13" "13"
#> [541] "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13"
#> [556] "6"  "13" "13" "13" "13" "13" "13" "11" "6"  "11" "11" "12" "13" "13" "13"
#> [571] "13" "13" "13" "13" "11" "11" "11" "11" "11" "12" "13" "13" "13" "13" "13"
#> [586] "13" "13" "13" "11" "6"  "12" "12" "12" "12" "13" "13" "13" "13" "13" "13"
#> [601] "13" "13" "12" "12" "12" "12" "12" "12" "13" "13" "13" "13" "13" "13" "13"
#> [616] "13" "13" "12" "12" "12" "12" "12" "12" "12" "13" "13" "13" "13" "13" "13"
#> [631] "13" "13" "12" "12" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "12"
#> [646] "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "12" "13" "13" "13" "13"
#> [661] "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13"
#> [676] "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13"
#> [691] "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13" "13"
#> [706] "13" "13" "13" "13" "13" "13" "13" "13"