slice_head.duckplyr_df | R Documentation |
This is a method for the dplyr::slice_head()
generic.
slice_head()
selects the first rows.
## S3 method for class 'duckplyr_df'
slice_head(.data, ..., n, prop, by = NULL)
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details. |
... |
For Provide either positive values to keep, or negative values to drop. The values provided must be either all positive or all negative. Indices beyond the number of rows in the input are silently ignored. For |
n , prop |
Provide either A negative value of |
by |
< |
There is no DuckDB translation in slice_head.duckplyr_df()
if by
or prop
is provided,
with a negative n
.
These features fall back to dplyr::slice_head()
, see vignette("fallback")
for details.
dplyr::slice_head()
library(duckplyr)
df <- data.frame(x = 1:3)
df <- slice_head(df, n = 2)
df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.