Description Usage Arguments Details Value Examples
In betr, an experiment consists of one or more stages, as well as global options defined when the experiment is created.
1 |
auth |
TRUE, FALSE, a character vector of patterns, or a function. See Details |
port |
what port to listen on |
autostart |
logical. Start the experiment automatically when N participants have joined? |
allow_latecomers |
logical. Allow participants to join after the experiment has started? |
N |
a numeric giving how many participants are required |
server |
a class name (quoted or unquoted) of a betr::Server subclass, or an instance object. Typical: "RookServer" |
name |
the character name of the experiment, used in creating folders. |
client_refresh |
numeric. How often should waiting clients refresh their pages? |
clients_in_url |
logical. If |
seats_file |
path of the file where seat information is stored. See
|
on_ready |
a user-defined function, to be called when |
randomize_ids |
if |
record |
records experiment commands to disk. Turning this off will save disk space and not clutter your working directory, but will prevent experiment replay. |
seed |
a seed to set whenever |
An experiment is typically created in a source file, which also adds one or
more stages to it using add_stage
. When you run the experiment,
you source this file. Call ready(experiment)
when you
want subjects to be able to connect to the server. They will see a waiting
page which refreshes regularly. To see your experiment's status, call
info(experiment)
or simply type experiment
on the
command line. When you want the experiment to start, call
start(experiment)
.
To keep your experiments replay-safe, use on_ready
to
initialize your data.
The parameter auth
determines how you authorize clients. TRUE
(the default) allows any client to join the experiment. If auth
is a
character vector, it is treated as a list of patterns in shell-glob style, e.g.
"192.168.*.*"
(see glob2rx
for details). If the
client's IP address matches any pattern, the client will be
accepted. IF auth
is a function, it will be called like auth(ip,
params, cookies)
where ip
is the remote IP address and params
and cookies
are lists of HTTP parameters and cookies respectively. The
client will be authorized if the function returns TRUE
.
an object of class Experiment.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.