autolayer function

Autolayer methods

Autolayer methods

Layers of annotation data to add to ggplots in `movementsync.

## S3 method for class 'OnsetsSelected' autolayer( object, time_limits = c(-Inf, Inf), colour = "Inst.Name", fill = "Metre", alpha = 0.4, instrument_cols = NULL, ... ) ## S3 method for class 'Metre' autolayer( object, time_limits = c(-Inf, Inf), colour = "hotpink", alpha = 0.5, tempo = FALSE, view = NULL, columns = NULL, ... ) ## S3 method for class 'Duration' autolayer( object, time_limits = c(-Inf, Inf), expr = .data$Tier == "FORM", fill_column = "Comments", geom = "rect", vline_column = "In", ... ) ## S3 method for class 'Splice' autolayer(object, geom = "rect", vline_column = "Start", ...)

Arguments

  • object: S3 object
  • time_limits: tuple of time limits.
  • colour: name of column for colouring.
  • fill: name of column for filling.
  • alpha: aesthetic
  • instrument_cols: instrument column names.
  • ...: passed to geom.
  • tempo: do we plot tempo with a Metre layer? (Default is FALSE).
  • view: view object for a tempo Metre layer (Default is NULL).
  • columns: columns for view for a tempo Metre layer (Default is NULL).
  • expr: unquoted R expression for filtering data (default is Tier =='FORM').
  • fill_column: data column used for fill.
  • geom: 'rect' or 'vline'.
  • vline_column: column name for position of vertical lines.

Returns

ggplot geom object

Examples

r<-get_recording("NIR_ABh_Puriya", fps=25) o <- get_onsets_selected_data(r) v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y"), maxpts=5000) + autolayer(o) m <- get_metre_data(r) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, time_limits = c(1000, 2000)) autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(1000, 2000)) + autolayer(m, tempo = TRUE, time_limits = c(1000, 2000), view = v, columns = c("LEar_x", "LEar_y")) d <- get_duration_annotation_data(r) autoplot(m) autoplot(m) + autolayer(d) autoplot(m) + autolayer(d, fill_col = "Tier") v <- get_raw_view(r, "Central", "", "Sitar") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d) autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, expr = Tier == "FORM" & substr(Comments, 1, 1) == "J") autoplot(v, columns = c("LEar_x", "LEar_y")) + autolayer(d, geom = "vline", nudge_x = -60, size = 3, colour = "blue")
  • Maintainer: Tuomas Eerola
  • License: MIT + file LICENSE
  • Last published: 2023-06-09

Useful links