disc {GD} | R Documentation |
Generates discretization parameters for continuous data.
Description
Function for discretizing continuous data and obtaining the different outputs, including discretization intervals, numbers of values within intervals, and visualization of discretization.
Usage
disc(var, n, method = "quantile", ManualItv)
## S3 method for class 'disc'
print(x, ...)
## S3 method for class 'disc'
plot(x, ...)
Arguments
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 |
Examples
## 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)
[Package GD version 10.3 Index]