cmps_signature_plot: Plot reference signature and comparison signature based on...

View source: R/cmps_plot.R

cmps_signature_plotR Documentation

Plot reference signature and comparison signature based on the results of CMPS algorithm

Description

This function aligns two signatures and shows which basis segments find the congruent registration position.

Usage

cmps_signature_plot(cmps_result, add_background = TRUE)

Arguments

cmps_result

a list generated by extract_feature_cmps. cmps_result is required to have the following names: parameters, congruent_seg, congruent_pos, segments, ccp_list. So include = "full_result" is recommended when computing cmps_result

add_background

boolean; whether or not to add zebra-striped background under each basis segment; default is TRUE

Value

a list

  • segment_shift_plot: a plot object generated by ggplot2. In this plot only basis segments that are congruent matching profile segments (CMPS) are plotted along with the comparison profile; each basis segment is shifted to the position where it obtains either a consistent correlation peak or a cross-correlation peak closest to the congruent registration position

  • signature_shift_plot: a plot object generated by ggplot2. In this plot both the reference signature and the comparison signature are plotted, and CMPS are highlighted. The alignment of the two signatures is achieved by shifting the reference signature to the congruent registration position.

  • seg_shift: a data.frame. This data frame shows which basis segments are plotted (are CMPS) and the units by which each segment shifted when plotting segment_shift_plot

  • sig_shift: a numeric value. The number of units by which the reference signature shifted when plotting signature_shift_plot

Examples

library(cmpsR)

data("bullets")
land2_3 <- bullets$sigs[bullets$bulletland == "2-3"][[1]]
land1_2 <- bullets$sigs[bullets$bulletland == "1-2"][[1]]

# compute cmps

# algorithm with multi-peak insepction at three different segment scales
cmps_with_multi_scale <- extract_feature_cmps(land2_3$sig, land1_2$sig, include = "full_result" )

# generate plots using cmps_signature_plot
sig_plot <- cmps_signature_plot(cmps_with_multi_scale)

cmpsR documentation built on July 18, 2022, 9:07 a.m.