profilesWake: Compute and plot "wake" profiles

Description Usage Arguments Value Examples

View source: R/profilesWake.R

Description

Users can compute average profiles and visualise the same. Averages can be performed either over Flies, Days, Both or None. Except in the case of "None" the output of this function will be a list with two elements. One is the generated plot and the other is a table with the activity values and corresponding standard errors of the mean.

Usage

1
2
3
4
5
6
7
profilesWake(
  data,
  bin = 30,
  t.cycle = 24,
  average.type = "Both",
  rm.channels = c()
)

Arguments

data

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

bin

Intervals in which data are saved (in minutes). This defaults to 30. This value must be the same as that for wakeData().

t.cycle

Define the period of the environmental cycle or a single day in hours. This defaults to 24. This value must be the same as that for wakeData().

average.type

Define how the averaging must be done for computing profiles. There are 4 choices; i) "Flies": This will average over all the flies for the number of days of data that there are, and produce an averaged time-series, ii) "Days": This will average activity over all the days but for each fly and provide 32 averaged plots, iii) "Both": This will average over both flies and days and provide one composite average profile, iv) "None": This will not average and produce any plots; the output will be the same as the input file. This defaults to "Both".

rm.channels

All the channels that users want to remove from their averaging. This must be a vector, i.e., channels must be separated by commas. For instance, if users choose to remove channels 1 to 5, 25 and 32, then the input should be either c(1,2,3,4,5,25,32) or c(1:5,25,32). This defaults to an empty vector, meaning no individuals are removed from analysis.

Value

Except when average.type = "None", a list with two items. When average.type = "None", input file is returned.

If average.type = "Days":

Profiles
ZT

Column with ZT values.

I1:I32

Data averaged over days for each of 32 flies.

ZT

Column with ZT values.

I1:I32

SEM (across days) for each of 32 flies.

Plot

A plotly htmlwidget with the wake profiles in a 4-by-8 array.

If average.type = "Flies":

Profiles
ZT

Column with ZT values.

Mean

Data averaged over all 32 flies for the entire duration of chosen days.

SEM

SEM (across flies).

Plot

A plotly htmlwidget with the wake time-series.

If average.type = "Both":

Profiles
ZT

Column with ZT values.

Mean

Data averaged over all days and all 32 flies.

SEM

SEM (across flies).

Plot

A plotly htmlwidget with the wake profile.

Examples

1
2
3
4
td <- trimData(data = df, start.date = "19 Dec 20", start.time = "21:00",
n.days = 3, bin = 1, t.cycle = 24)
wd <- wakeData(td)
pro <- profilesWake(data = wd)

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

Related to profilesWake in phase...