as.data.frame.simulab_sim: Convert a simulation component to a tidy data frame

View source: R/result.R

as.data.frame.simulab_simR Documentation

Convert a simulation component to a tidy data frame

Description

Convert a simulation component to a tidy data frame

Usage

## S3 method for class 'simulab_sim'
as.data.frame(x, row.names = NULL, optional = FALSE, what = "data", ...)

Arguments

x

A simulab_sim object.

row.names

Ignored.

optional

Ignored.

what

Single string naming the table to return, default "data" for the primary simulated observations. Use components(x) to list the available choices; an unrecognized name is an error that lists them.

...

Reserved for future methods.

Value

A plain base data.frame (the simulab_sim class and attributes are dropped) containing the requested simulation table.

Examples

result <- simulate_ttest(
  n_a = 10,
  n_b = 10,
  mean_a = 0,
  mean_b = 0.5,
  seed = 1
)
as.data.frame(result)
as.data.frame(result, what = "parameters")

simulab documentation built on Oct. 15, 2026, 5:08 p.m.