Learn R Programming

TrialEmulation (version 0.0.4.2)

sample_expanded_data: Internal method to sample expanded data

Description

Internal method to sample expanded data

Usage

sample_expanded_data(
  object,
  p_control,
  period = NULL,
  subset_condition = NULL,
  seed
)

# S4 method for te_datastore sample_expanded_data( object, p_control, period = NULL, subset_condition = NULL, seed )

Value

A data.frame of class data.table.

Arguments

object

An object of class te_datastore.

p_control

Probability of selecting a control.

period

An integerish vector of non-zero length to select trial period(s) or NULL (default) to select all trial periods.

subset_condition

A string or NULL.

seed

An integer seed or NULL (default).

Examples

Run this code
# Data object normally created by [expand_trials]
datastore <- new("te_datastore_datatable", data = te_data_ex$data, N = 50139L)

sample_expanded_data(datastore, period = 260:275, p_control = 0.2, seed = 123)

Run the code above in your browser using DataLab