summary.bins | R Documentation |
summary method for "bins" and "optimal_bins".
## S3 method for class 'bins'
summary(object, ...)
## S3 method for class 'bins'
print(x, ...)
object |
an object of "bins" and "optimal_bins", usually, a result of a call to binning(). |
... |
further arguments passed to or from other methods. |
x |
an object of class "bins" and "optimal_bins", usually, a result of a call to binning(). |
print.bins() prints the information of "bins" and "optimal_bins" objects nicely. This includes frequency of bins, binned type, and number of bins. summary.bins() returns data.frame including frequency and relative frequency for each levels(bins).
See vignette("transformation") for an introduction to these concepts.
The function summary.bins() computes and returns a data.frame of summary statistics of the binned given in object. Variables of data frame is as follows.
levels : levels of factor.
freq : frequency of levels.
rate : relative frequency of levels. it is not percentage.
binning
# Generate data for the example
heartfailure2 <- heartfailure
heartfailure2[sample(seq(NROW(heartfailure2)), 20), "platelets"] <- NA
# Binning the platelets variable. default type argument is "quantile"
bin <- binning(heartfailure2$platelets)
# Print bins class object
bin
# Summarize bins class object
summary(bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.