musicnot: Generate music notation graph of social interactions

Description Usage Arguments Value References Further details Examples

Description

Generate music notation graph of social interactions

Usage

1
2
3
musicnot(df, ranks = NULL, arrowsize = 0.3, arrowweight = 0.75,
  pointsize = 3, ylabel = NULL, colors = "default", gridcolors = NULL,
  gridlinesize = 1, labels = "rank", behav = "default")

Arguments

df

A dataframe with at least 3 columns in the order: time, id1, id2. Every observation/row should be a mututally exclusive behavioral event. The first variable, time, can be in numeric or date/time format. The 2nd and 3rd variables, id1 and id2 should be character variables denoting the id of the individual (id1) directing each behavior to the other individual (id2) that receives the behavior. If want to discriminate lines by different behaviors, a 4th column should be the behavior of interest. Other columns are permissible in the dataframe that come after these required variables.

ranks

The default is NULL meaning that individuals will be plotted in alphanumerical order. Otherwise, a character vector indicating the rank of individuals (from highest to lowest) which will determine the plotted order of individuals.

arrowsize

The size of the arrowhead.

arrowweight

The weight of the arrowhead.

pointsize

The size of points.

ylabel

The y-axis title.

colors

The colors to be used for plotting. The defualt is type="default" meaning the default ggplot2 color palette is used. Other options are: type="terrain", type="heat" type="cm", type="random", type="grays" type="rainbow", type="topo", or alternatively a character vector of color names or codes of can be used.

gridcolors

default is to use grey horizontal grid lines, but if type="gridcolors=T" then horizontal grid lines of the same color as each individual will be used.

gridlinesize

Weight/size of gridlines.

labels

Default is type="rank" which will use numeric values as y-axis labels, but if type="name" then the individual's id will be used.

behav

Default is type="default" which is to not differentiate different behaviors in the plot, but if type="yes" then lines will be differentially styled (dotted, dashed, etc.) to distinguish different behaviors. A character vector with the names of each behavior can be used to determine the order in which different line styles are to be applied. To change from type="default" requires a 4th variable in the dataframe identifying the behavior at each observation.

Value

A music notation graph of social interactions.

References

Ivan D. Chase, (2006), Music notation: a new method for visualizing social interaction in animals and humans Frontiers in Zoology 3: 18

Further details

tba

Examples

1
2
3
4
5
6
7
musicnot(flies)
musicnot(flies, gridcolors=T)
musicnot(flies, gridcolors=T, gridlinesize=0.5)
musicnot(flies, gridcolors=T, gridlinesize=0.5, colors="topo")
musicnot(flies, gridcolors=T, gridlinesize=0.5, colors="rainbow")
musicnot(flies, gridcolors=T, gridlinesize=0.5, labels="name")
musicnot(flies, gridcolors=T, gridlinesize=0.5, behav="yes")

SBUtltmedia/musicnotationR documentation built on May 9, 2019, 11:07 a.m.