The R Project SVN R

Rev

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

Rev 68948 Rev 75167
Line 1... Line 1...
1
% File src/library/base/man/zapsmall.Rd
1
% File src/library/base/man/zapsmall.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-2009 R Core Team
3
% Copyright 1995-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{zapsmall}
6
\name{zapsmall}
7
\alias{zapsmall}
7
\alias{zapsmall}
8
\title{Rounding of Numbers}
8
\title{Rounding of Numbers: Zapping Small Ones to Zero}
9
\usage{
9
\usage{
10
zapsmall(x, digits = getOption("digits"))
10
zapsmall(x, digits = getOption("digits"))
11
}
11
}
12
\description{
12
\description{
13
  \code{zapsmall} determines a \code{digits} argument \code{dr} for
13
  \code{zapsmall} determines a \code{digits} argument \code{dr} for
14
  calling \code{round(x, digits = dr)} such that values close to
14
  calling \code{round(x, digits = dr)} such that values close to
15
  zero (compared with the maximal absolute value) are \sQuote{zapped},
15
  zero (compared with the maximal absolute value) are \sQuote{zapped},
16
  i.e., treated as \code{0}.
16
  i.e., replaced by \code{0}.
17
}
17
}
18
\arguments{
18
\arguments{
19
  \item{x}{a numeric or complex vector.}
19
  \item{x}{a numeric or complex vector or any \R number-like object
-
 
20
    which has a \code{\link{round}} method and basic arithmetic methods
-
 
21
    including \code{\link{log10}()}.}
20
  \item{digits}{integer indicating the precision to be used.}
22
  \item{digits}{integer indicating the precision to be used.}
21
}
23
}
22
\references{
24
\references{
23
  Chambers, J. M. (1998)
25
  Chambers, J. M. (1998)
24
  \emph{Programming with Data.  A Guide to the S Language}.
26
  \emph{Programming with Data.  A Guide to the S Language}.