You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* clarify first() vs x[1]
* also updated docs for last
* mention similar behaviour of head(,1) with integer(0)
* head() and tail() preserve attributes
* Final
Note: For zero-length vectors, \code{first(x)} and \code{last(x)} mimic \code{head(x, 1)} and \code{tail(x, 1)} by returning an empty vector instead of \code{NA}. However, unlike \code{head()}/\code{tail()} and base R subsetting (e.g., \code{x[1]}), they do not preserve attributes like names.
23
+
}
21
24
\value{
22
25
If no other arguments are supplied it depends on the type of \code{x}. The first/last item
23
26
of a vector or list. The first/last row of a \code{data.frame} or \code{data.table}.
0 commit comments