sortbin | R Documentation |
Sorts and bins the rows of the data frame x
according the sorting columns in sortCol
.
decreasing
and na.last
are recycled is necessary. If equibin
is TRUE
and nBins==NA
then nBins
is set to 100
. If equibin
is FALSE
and nBins==NA
then the bins are returned as they come from sorting; only identical values are
in one bin. If nBins
is positive then the bins are merged until nBins
reached.
Note that the numbers of observations per bin may vary.
sortbin( x, sortCol = 1, decreasing = FALSE, na.last = TRUE, nBins = NA, equibin = TRUE )
x |
data frame |
sortCol |
numeric/character: names or indices of variable used for sorting (default: |
decreasing |
logical: should the sort order be increasing or decreasing (default: |
na.last |
logical: for controlling the treatment of NAs (default: |
nBins |
integer: maximal number of bins (default: |
equibin |
logical: should the number of observations equal per bin (default: |
(non-sequential) bin numbers as integer
data("Boston", package="MASS") tableplot(Boston, bin=sortbin(Boston))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.