The R Project SVN R

Rev

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

Rev 69812 Rev 77213
Line 54... Line 54...
54
  (\eqn{ = \max vec}{ = max(vec)}), is \code{N - 1} as for all other
54
  (\eqn{ = \max vec}{ = max(vec)}), is \code{N - 1} as for all other
55
  values in the last interval.
55
  values in the last interval.
56
 
56
 
57
  \code{left.open = TRUE} is occasionally useful, e.g., for survival data.
57
  \code{left.open = TRUE} is occasionally useful, e.g., for survival data.
58
  For (anti-)symmetry reasons, it is equivalent to using
58
  For (anti-)symmetry reasons, it is equivalent to using
59
  \dQuote{mirrored} data, i.e., the following is always true: \preformatted{
59
  \dQuote{mirrored} data, i.e., the following is always true:
-
 
60
  \preformatted{
60
    identical(
61
    identical(
61
          findInterval( x,  v,      left.open= TRUE, ...) ,
62
          findInterval( x,  v,      left.open= TRUE, ...) ,
62
      N - findInterval(-x, -v[N:1], left.open=FALSE, ...) )
63
      N - findInterval(-x, -v[N:1], left.open=FALSE, ...) )
63
    }
64
  }
64
    where \code{N <- length(vec)} as above.
65
  where \code{N <- length(vec)} as above.
65
}
66
}
66
\value{
67
\value{
67
  vector of length \code{length(x)} with values in \code{0:N} (and
68
  vector of length \code{length(x)} with values in \code{0:N} (and
68
  \code{NA}) where \code{N <- length(vec)}, or values coerced to
69
  \code{NA}) where \code{N <- length(vec)}, or values coerced to
69
  \code{1:(N-1)} if and only if \code{all.inside = TRUE} (equivalently coercing all
70
  \code{1:(N-1)} if and only if \code{all.inside = TRUE} (equivalently coercing all