File: firstNA.Rd

package info (click to toggle)
r-cran-bit 4.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,000 kB
  • sloc: ansic: 5,145; sh: 13; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/integerutil.R
\name{firstNA}
\alias{firstNA}
\title{Position of first NA}
\usage{
firstNA(x)
}
\arguments{
\item{x}{an R vector}
}
\value{
a reversed vector
}
\description{
This is substantially faster than \code{which.max(is.na(x))}
}
\examples{
x <- c(FALSE, NA, TRUE)
firstNA(x)
reverse_vector(x)
\dontrun{
x <- 1:1e7
system.time(rev(x))
system.time(reverse_vector(x))
}
}
\seealso{
\code{\link[=which.max]{which.max()}}, \code{\link[=is.na]{is.na()}}, \code{\link[=anyNA]{anyNA()}}, \code{\link[=anyDuplicated]{anyDuplicated()}}, \code{\link[=bit_anyDuplicated]{bit_anyDuplicated()}}
}