Skip to contents

Adds an analysis trigger when a fraction of the target sample enrolls.

Usage

trigger_by_fraction(fraction, timer, sample_size, analysis = NULL)

Arguments

fraction

numeric Sample fraction (0 < fraction <= 1).

timer

Timer instance to update.

sample_size

integer Target sample size.

analysis

function or NULL Optional function to apply.

Value

Invisible Timer.

Examples

t <- Timer$new("timer")
trigger_by_fraction(0.5, t, sample_size = 100, analysis = function(df, current_time) nrow(df))