MINI MINI MANI MO
%
% Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
%
\name{slice}
\alias{slice}
\alias{slice_}
\title{Select Rows by Positions}
\usage{
slice(.data, ...)
slice_(.data, ..., .dots)
}
\arguments{
\item{.data}{An ordered \code{\link[OREbase:ore.frame-class]{ore.frame}} object.}
\item{...}{An integer vector specifying row positions.}
\item{.dots}{Used to work around non-standard evaluation. See
\code{\link[dplyr]{slice_}} for details.}
}
\description{
\code{slice} works with ordered \code{\link[OREbase:ore.frame-class]{ore.frame}} object. It ignores the grouping of the input \code{ore.frame}.
}
\examples{
MTCARS <- ore.push(mtcars)
rownames(MTCARS)
slice(MTCARS, 1L)
slice(MTCARS, n())
slice(MTCARS, 25:n())
MTCARS <- arrange(MTCARS, hp)
slice(MTCARS, 1L)
slice(MTCARS, n())
slice(MTCARS, 25:n())
# grouping is ignored by slice
# use filter and row_number to obtain slices per group
by_cyl <- group_by(MTCARS, cyl)
filter(by_cyl, row_number(hp) < 3L) # slice(by_cyl, 1:2)
}
\seealso{
Other single.table.verbs: \code{\link{arrange}},
\code{\link{arrange_}}; \code{\link{filter}},
\code{\link{filter_}}; \code{\link{mutate}},
\code{\link{mutate_}}, \code{\link{transmute}},
\code{\link{transmute_}}; \code{\link{rename}},
\code{\link{rename_}}, \code{\link{select}},
\code{\link{select_}}; \code{\link{summarise}},
\code{\link{summarise_}}
}
OHA YOOOO