simulate_facs: Simulate simple FACS data

Description Usage Arguments Details Value Author(s) Examples

View source: R/simulate_facs.R

Description

Simulate simple FACS data

Usage

1
simulate_facs(n_aus = 5, n_events = 200, n_contexts = 2, n_subjects = 10)

Arguments

n_aus

numeric, number of action units (default is 5). Can't be larger than 26.

n_events

numeric, number of events (default is 200)

n_contexts

numeric, number of contexts (default is 2). Must be not larger than n_aus.

n_subjects

numeric, number of subjects (default is 10)

Details

The function generates data such that a given AU will appear most often in one context and rarely in other contexts.

Subjects become relevant only for the durations of events, i.e. some subjects tend to have longer events while others have shorter events (which is independent of context).

It is possible that the results contain events without any AU present.

Value

a data.frame with one row per event and one column for each AU, and columns for context, subject code and duration.

Author(s)

Christof Neumann

Examples

1
2
3
4
5
6
xdata <- simulate_facs(n_aus = 5,
                       n_events = 200,
                       n_contexts = 1,
                       n_subjects = 3)
head(xdata)
boxplot(xdata$duration ~ xdata$subject)

gobbios/testingtravis documentation built on July 26, 2020, 7:22 a.m.