splineFillCpp: Interpolate using spline

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Interpolate using spline

Usage

1
splineFillCpp(x, y, xout)

Arguments

x

(numeric) A numeric matrix with similarity values of two sequences or signals.

y

(numeric) Penalty for introducing first gap in alignment.

xout

(numeric) Penalty for introducing subsequent gaps in alignment.

Value

(numeric)

Author(s)

Shubham Gupta, shubh.gupta@mail.utoronto.ca ORCID: 0000-0003-3500-8152 License: (c) Author (2021) + MIT Date: 2021-01-06

Examples

1
2
3
4
5
6
7
time <- seq(from = 3003.4, to = 3048, by = 3.4)
y <- c(0.2050595, 0.8850070, 2.2068768, 3.7212677, 5.1652605, 5.8288915, 5.5446804,
       4.5671360, 3.3213154, 1.9485889, 0.9520709, 0.3294218, 0.2009581, 0.1420923)
y[c(1,6)] <- NA_real_
idx <- !is.na(y)
splineFillCpp(time[idx], y[idx], time[!idx])
zoo::na.spline(zoo::zoo(y[idx], time[idx]), xout = time[!idx], method = "natural")

Roestlab/DIAlignR documentation built on March 3, 2021, 9:09 a.m.