allSomnograms: Generate actograms for sleep data (Somnograms)

Description Usage Arguments Value Examples

View source: R/allSomnograms.R

Description

This function generates a composite figure with actograms (referred to as somnograms, here) for all flies in a DAM scanned monitor file. Input for this function must be an output from the trimData() function. The output of this function is a large plotly object. This function requires the packages "plotly" and "zoo". In a particular bin, sleep is calculated as the total minutes of inactivity equal to or greater than the defined threshold (sleep.def; typically, 5-minutes).

Usage

1
allSomnograms(data, sleep.def = c(5), bin = 30, t.cycle = 24)

Arguments

data

Input data file. The input for this function must be the output of the function trimData(). See ??trimData().

sleep.def

Definition of sleep. Traditionally, a single bout of sleep is defined as any duration of inactivity that is equal to or greater than 5-minutes. However, sometimes it may be of interest to examine longer bouts of sleep or specific bout durations; sleep.def allows users to change the definition of sleep. The default input is a single value vector of value 5. If users wish to analyse sleep only between 5 to 20 mins, the input must be c(5,20).

bin

Intervals in which data are saved (in minutes). This defaults to 30. The value of bin cannot be lower than that of sleep.def.

t.cycle

Define the period of the environmental cycle or a single day in hours. This defaults to 24.

Value

A plotly htmlwidget with 32 somnograms in a 4-by-8 array.

Examples

1
2
3
td <- trimData(data = df, start.date = "19 Dec 20", start.time = "21:00",
n.days = 3, bin = 1, t.cycle = 24)
somnograms <- allSomnograms(data = td[,1:15])

phase documentation built on Aug. 17, 2021, 1:06 a.m.

Related to allSomnograms in phase...