period: Begin a new period, optionally waiting for other subjects

Description Usage Arguments Details Value See Also Examples

Description

A period may contain one or more stages. When the experiment is started, all subjects are in period 1. Typically, you will want a new period for each "repetition" of an experiment. You can then store the data in a data frame which looks like:

Usage

1
period(wait_for="none")

Arguments

wait_for
name

Optional name of the stage

Details

ID period ...
1 1 ...
1 2 ...
1 ... ...
2 1 ...
... ... ...

Iwait_for is interpreted just as in checkpoint.

If all relevant subjects are ready, the subject's period counter is incremented and the subject moves on.

Value

An object of class Period

See Also

Other stages: NEXT, WAIT, stage; checkpoint; form_stage; program; text_stage; timed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
expt <- experiment(N=4)
groups <- c("A", "A", "B", "B")
s1 <- text_stage(page="<html><body><form action=''>
     <input type='submit' value='Next'></form></body></html>")

# go ahead individually:
add_stage(expt, period(), s1)

# wait for everyone:
add_stage(expt, period("all"), s1)

# players 1 and 2 wait for each other, so do 3 and 4:
add_stage(expt, period(groups), s1)

hughjonesd/betr documentation built on May 17, 2019, 9:11 p.m.