Learn R Programming

movementsync (version 0.1.5)

autoplot: Diagnostic plots

Description

Autoplot methods for S3 objects in the movementsync package.

Usage

# S3 method for Duration
autoplot(object, horizontal = FALSE, ...)

# S3 method for OnsetsSelected autoplot(object, instrument = "Inst", tactus = "Matra", ...)

# S3 method for Metre autoplot(object, ...)

# S3 method for View autoplot( object, columns = NULL, maxpts = 1000, time_limits = c(-Inf, Inf), time_breaks = NULL, expr = NULL, ... )

# S3 method for SplicedView autoplot( object, columns = NULL, segments = NULL, time_breaks = NULL, time_limits = c(-Inf, Inf), maxpts = 1000, ... )

Value

a ggplot object.

Arguments

object

S3 object

horizontal

make the barchart horizontal? (Default is FALSE).

...

passed to zoo::plot.zoo().

instrument

instrument column name.

tactus

beat column name.

columns

names of columns in input data.

maxpts

maximum number of points to plot

time_limits

tuple to restrict the timeline or a duration object.

time_breaks

suggests the number of major time tick marks (Default is NULL).

expr

an R expression that sets the time scale using a duration object (Default is NULL).

segments

only include these segments in a SplicedView plot.

Examples

Run this code
r <- get_sample_recording()
d <- get_duration_annotation_data(r)
autoplot(d)
o <- get_onsets_selected_data(r)
autoplot(o)
m <- get_metre_data(r)
autoplot(m)
v <- get_raw_view(r, "Central", "", "Sitar")
autoplot(v, columns = c("LEar_x", "LEar_y"), time_limits = c(20, 40))
l <- list(a = c(0, 10), b = c(20, 30), c = c(30, 60))
splicing_df <- splice_time(l)
sv <- get_spliced_view(v, splicing_df)
autoplot(sv, columns = c("LEar_x", "LEar_y", "Nose_x", "Nose_y"), time_breaks = 4, maxpts = 1000)

Run the code above in your browser using DataLab