toy_activity_data | R Documentation |
This function generates random data that emulates some of the features of fruit fly activity and sleep. This is designed exclusively to provide material for examples and tests as it generates "realistic" datasets of arbitrary length.
toy_activity_data(
metadata = NULL,
seed = 1,
rate_range = 1/c(60, 10),
duration = days(5),
sampling_period = 10,
...
)
toy_ethoscope_data(...)
toy_dam_data(...)
metadata |
data.frame where every row defines an individual.
Typically |
seed |
random seed used (see set.seed) |
rate_range |
parameter defining the boundaries of the rate at which animals wake up. It will be uniformly distributed between animals, but fixed within each animal. |
duration |
length (in seconds) of the data to generate |
sampling_period |
sampling period (in seconds) of the resulting data |
... |
additional arguments to be passed to |
a behavr table with the metadata columns as metavariables.
In addition to id
and t
columns different methods will output different variables:
toy_activity_data
will have asleep
and moving
(1/10s)
toy_dam_data
will have activity
(1/60s)
toy_ethoscope_data
will have xy_dist_log10x1000
, has_interacted
and x
(2/1s)
The relevant rethomic tutorial section – explainig how to work with toy data.
behavr – to formally create a behavr object
# just one animal, no metadata needed
dt <- toy_ethoscope_data(duration = days(1))
# advanced, using a metadata
metadata <- data.frame(id = paste0("toy_experiment|",1:9),
condition = c("A", "B", "C"))
metadata
# Data that could come from the scopr package:
dt <- toy_ethoscope_data(metadata, duration = days(1))
print(dt)
# Some DAM-like data
dt <- toy_dam_data(metadata, seed = 2, duration = days(1))
print(dt)
# data where behaviour is annotated e.g. by a classifier
dt <- toy_activity_data(metadata, 1.5)
print(dt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.