barPlot: Create a bar plot of an experiment

Description Usage Arguments Value Examples

Description

Create a bar plot from calculated statistics (plots data means by attribute). Error bars represent the standard error of the mean. Plot is automatically faced if using multiple timepoints. Do not use this function for datasets with a large number of timepoints (use linePlot instead). All ggplot2 functions will work on the resulting plot. If you want to plot a vector of numeric values (like survival time or # of sleep bouts), supply the "vector" argument (of the values you wish to use) along with the obj/attribute the values were originally generated from.

Usage

1
barPlot(obj, attribute, ..., vector)

Arguments

obj

A valid DAM S4 object

attribute

The attribute of the data you wish to examine (like "genotype")

vector

A vector of values, with one for each animal in the experiment

Value

Returns a ggplot2 plot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sleep <- dropDead(DAM_DD)
sleep <- calcSleep(sleep)
sleep <- toInterval(sleep, 12, units = "hours", aggregateBy = "average")
sleep <- toAvgDay(sleep)
barPlot(sleep, "genotype")

sleep <- dropDead(DAM_DD)
sleep <- calcSleep(sleep)
bouts <- calcMeanBout(sleep)
barPlot(sleep, "genotype", vector = bouts)

jstaf/actmon documentation built on May 20, 2019, 2:11 a.m.