The R Project SVN R

Rev

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

Rev 68948 Rev 71255
Line 1... Line 1...
1
% File src/library/base/man/tabulate.Rd
1
% File src/library/base/man/tabulate.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2012 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{tabulate}
6
\name{tabulate}
7
\title{Tabulation for Vectors}
7
\title{Tabulation for Vectors}
8
\description{
8
\description{
Line 17... Line 17...
17
    \item{bin}{a numeric vector (of positive integers), or a factor.
17
    \item{bin}{a numeric vector (of positive integers), or a factor.
18
      \link{Long vectors} are supported.}
18
      \link{Long vectors} are supported.}
19
    \item{nbins}{the number of bins to be used.}
19
    \item{nbins}{the number of bins to be used.}
20
}
20
}
21
\details{
21
\details{
22
   \code{tabulate} is the workhorse for the \code{\link{table}} function.
22
  \code{tabulate} is the workhorse for the \code{\link{table}} function.
23
 
23
 
24
  If \code{bin} is a factor, its internal integer representation
24
  If \code{bin} is a factor, its internal integer representation
25
  is tabulated.
25
  is tabulated.
26
 
26
 
27
  If the elements of \code{bin} are numeric but not integers,
27
  If the elements of \code{bin} are numeric but not integers,
28
  they are truncated by \code{\link{as.integer}}.
28
  they are truncated by \code{\link{as.integer}}.
29
}
29
}
30
\value{
30
\value{
-
 
31
  An integer valued \code{\link{integer}} or \code{\link{double}} vector
31
  An integer vector (without names).  There is a bin for each of the
32
  (without names).  There is a bin for each of the values \code{1,
32
  values \code{1, \dots, nbins}; values outside that range and \code{NA}s
33
  \dots, nbins}; values outside that range and \code{NA}s are (silently)
33
  are (silently) ignored.
34
  ignored.
34
 
35
 
35
  On 64-bit platforms \code{bin} can have \eqn{2^{31}}{2^31} or more
36
  On 64-bit platforms \code{bin} can have \eqn{2^{31}}{2^31} or more
-
 
37
  elements (i.e., \code{length(bin) > .Machine$integer.max}), and hence
36
  elements and hence a count could exceed the maximum integer: this is
38
  a count could exceed the maximum integer.  For this reason, the return
37
  currently an error.
39
  value is of type double for such long \code{bin} vectors.
38
}
40
}
39
\seealso{
41
\seealso{
40
  \code{\link{table}}, \code{\link{factor}}.
42
  \code{\link{table}}, \code{\link{factor}}.
41
}
43
}
42
\examples{
44
\examples{