Description Usage Arguments Details Value Author(s) Examples
View source: R/simulate_facs.R
Simulate simple FACS data
1 | simulate_facs(n_aus = 5, n_events = 200, n_contexts = 2, n_subjects = 10)
|
n_aus |
numeric, number of action units (default is |
n_events |
numeric, number of events (default is |
n_contexts |
numeric, number of contexts (default is |
n_subjects |
numeric, number of subjects (default is |
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.
a data.frame
with one row per event and one column for each
AU, and columns for context, subject code and duration.
Christof Neumann
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.