The R Project SVN R

Rev

Rev 61168 | Rev 65894 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61168 Rev 61433
Line 63... Line 63...
63
  the intervals after sorting.
63
  the intervals after sorting.
64
}
64
}
65
\value{
65
\value{
66
  A \code{\link{factor}} is returned, unless \code{labels = FALSE} which
66
  A \code{\link{factor}} is returned, unless \code{labels = FALSE} which
67
  results in an integer vector of level codes.
67
  results in an integer vector of level codes.
68
  
68
 
69
  Values which fall outside the range of \code{breaks} are coded as
69
  Values which fall outside the range of \code{breaks} are coded as
70
  \code{NA}, as are \code{NaN} and \code{NA} values.
70
  \code{NA}, as are \code{NaN} and \code{NA} values.
71
}
71
}
72
\note{
72
\note{
73
  Instead of \code{table(cut(x, br))}, \code{hist(x, br, plot = FALSE)} is
73
  Instead of \code{table(cut(x, br))}, \code{hist(x, br, plot = FALSE)} is
Line 85... Line 85...
85
  \code{\link{findInterval}}.
85
  \code{\link{findInterval}}.
86
 
86
 
87
  \code{\link{quantile}} for ways of choosing breaks of roughly equal
87
  \code{\link{quantile}} for ways of choosing breaks of roughly equal
88
  content (rather than length).
88
  content (rather than length).
89
 
89
 
90
  \code{\link{.bincode}} for a bare-bones version. 
90
  \code{\link{.bincode}} for a bare-bones version.
91
}
91
}
92
\examples{
92
\examples{
93
Z <- stats::rnorm(10000)
93
Z <- stats::rnorm(10000)
94
table(cut(Z, breaks = -6:6))
94
table(cut(Z, breaks = -6:6))
95
sum(table(cut(Z, breaks = -6:6, labels = FALSE)))
95
sum(table(cut(Z, breaks = -6:6, labels = FALSE)))