keep_first() (keep_last) keeps the first (last) n entries to occur by date ordering.

keep_first(x, n, ...)

# S3 method for default
keep_first(x, n, ...)

# S3 method for incidence_df
keep_first(x, n, ...)

# S3 method for grates_yearweek
keep_first(x, n, ...)

# S3 method for grates_month
keep_first(x, n, ...)

# S3 method for grates_quarter
keep_first(x, n, ...)

# S3 method for grates_year
keep_first(x, n, ...)

# S3 method for grates_period
keep_first(x, n, ...)

keep_last(x, n, ...)

# S3 method for default
keep_last(x, n, ...)

# S3 method for incidence_df
keep_last(x, n, ...)

# S3 method for grates_yearweek
keep_last(x, n, ...)

# S3 method for grates_month
keep_last(x, n, ...)

# S3 method for grates_quarter
keep_last(x, n, ...)

# S3 method for grates_year
keep_last(x, n, ...)

# S3 method for grates_period
keep_last(x, n, ...)

Arguments

x

Object to filter.

n

Number of entries to keep.

...

Not currently used.

Value

The objected with the chosen entries.