xobs_only: Generate Observed Combinations Only

View source: R/xobs-only.R

xobs_onlyR Documentation

Generate Observed Combinations Only

Description

Generate Observed Combinations Only

Usage

xobs_only(..., .length_out = NULL, .data = xnew_data_env$data)

Arguments

...

One or more variables to generate combinations for.

.length_out

A count to override the default length of sequences.

.data

Normally defined by xnew_data(), users must pass a data frame or tibble if using this function directly.

See Also

xnew_data()

Examples

data <- tibble::tibble(
  period = factor(c("before", "before", "after", "after"),
    levels = c("before", "after")),
  annual = factor(c(1, 3, 5, 8), levels = c(1, 3, 5, 8)))
xnew_data(data, period, annual)
xnew_data(data, xobs_only(period, annual))
xnew_data(data, xobs_only(period, xnew_seq(annual, length_out = 3)))

poissonconsulting/newdata documentation built on Jan. 18, 2024, 1:30 a.m.