The R Project SVN R

Rev

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

Rev 75810 Rev 76047
Line 1... Line 1...
1
% File src/library/base/man/which.Rd
1
% File src/library/base/man/which.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-2018 R Core Team
3
% Copyright 1995-2019 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{which}
6
\name{which}
7
\alias{which}
7
\alias{which}
8
\alias{arrayInd}
8
\alias{arrayInd}
Line 31... Line 31...
31
   column names.  \code{.dimnames[[1]]} is used as row names.}
31
   column names.  \code{.dimnames[[1]]} is used as row names.}
32
 \item{useNames}{logical indicating if the value of \code{arrayInd()}
32
 \item{useNames}{logical indicating if the value of \code{arrayInd()}
33
   should have (non-null) dimnames at all.}
33
   should have (non-null) dimnames at all.}
34
}
34
}
35
\value{
35
\value{
36
  If \code{arr.ind == FALSE} (the default), an integer vector with
36
  If \code{arr.ind == FALSE} (the default), an integer vector,
-
 
37
  or a double vector if \code{x} is a \emph{long vector}, with
37
  \code{length} equal to \code{sum(x)}, i.e., to the number of
38
  \code{length} equal to \code{sum(x)}, i.e., to the number of
38
  \code{TRUE}s in \code{x}.
39
  \code{TRUE}s in \code{x}.
39
 
40
 
40
  Basically, the result is \code{(1:length(x))[x]} in typical cases;
41
  Basically, the result is \code{(1:length(x))[x]} in typical cases;
41
  more generally, including when \code{x} has \code{\link{NA}}'s,
42
  more generally, including when \code{x} has \code{\link{NA}}'s,