-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
44 lines (32 loc) · 989 Bytes
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tvdenoising
<!-- badges: start -->
[![R-CMD-check](https://github.com/glmgen/tvdenoising/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/glmgen/tvdenoising/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
This package provides an `R` frontend to a `C` implementation of linear-time
univariate total variation denoising via dynamic programming (Johnson 2013).
## Installation
You can install the development version of tvdenoising from [GitHub](https://github.com/) with:
``` r
# install.packages("pak")
pak::pak("glmgen/tvdenoising")
```
## Example
```{r example}
library(tvdenoising)
y <- c(rnorm(30), rnorm(40, 2), rnorm(30))
yhat <- tvdenoising(y, 10)
plot(y, pch = 16)
lines(yhat, col = 2)
```