Skip to contents

Get the average power on each segment in a SplicedView

Usage

ave_power_spliceview(
  sv,
  column,
  colour = "blue",
  segments = NULL,
  show_plot = FALSE,
  ...
)

Arguments

sv

SplicedView object

column

name of data column on which to calculate average power.

colour

name of colour on plots (default is 'blue').

segments

indices of segments to plot e.g. 1:10 (default plots up to first 10).

show_plot

show a plot? (Default is FALSE).

...

passed to analyze_wavelet().

Value

data.frame with columns containing Average Power for each segment.

Examples

r <- get_sample_recording()
d1 <- get_duration_annotation_data(r)
# only one relevant section for sample data
splicing_smile_df <- splice_time(d1, tier ='INTERACTION',
  comments = 'Mutual look and smile')

fv_list <- get_filtered_views(r, data_points = "Nose", n = 41, p = 3)
jv <- get_joined_view(fv_list)
sv_duration_smile <- get_spliced_view(jv, splicing_df = splicing_smile_df)
ave_power_smile <- ave_power_spliceview(sv_duration_smile,
  column = "Nose_x_Central_Sitar", show_plot=TRUE)
#> Starting wavelet transformation...
#> ... and simulations... 
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#> Class attributes are accessible through following names:
#> series loess.span dt dj Wave Phase Ampl Power Power.avg Power.pval Power.avg.pval Ridge Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz 

head(ave_power_smile)
#>       Period Mutual look and smile
#> 1 0.08000000              4.137011
#> 2 0.08282119              6.200655
#> 3 0.08574188              8.913011
#> 4 0.08876556             12.205212
#> 5 0.09189587             15.819750
#> 6 0.09513657             19.277494