disc | R Documentation |
Function for discretizing continuous data and obtaining the different outputs, including discretization intervals, numbers of values within intervals, and visualization of discretization.
disc(var, n, method = "quantile", ManualItv)
## S3 method for class 'disc'
print(x, ...)
## S3 method for class 'disc'
plot(x, ...)
var |
A numeric vector of continuous variable |
n |
The numeber of intervals |
method |
A character of discretization method |
ManualItv |
A numeric vector of manual intervals |
x |
A list of |
... |
Ignore |
## method is default (quantile); number of intervals is 4
ds1 <- disc(ndvi_40$Tempchange, 4)
ds1
## method is equal; number of intervals is 4
ds2 <- disc(ndvi_40$Tempchange, 4, method = "equal")
## method is manual; number of intervals is 4
manualitv1 <- c(-0.5, 0, 1, 2, 4)
ds3 <- disc(ndvi_40$Tempchange, 4, method = "manual", ManualItv = manualitv1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.