rm_spikes: Remove spikes

Description Usage Arguments Value Examples

View source: R/rm_spikes.R

Description

Removes spikes, and sets their value to NA_real_.

Usage

1
rm_spikes(df, tolerance)

Arguments

df

data frame with date and numeric variable in the first and second column respectively (from read_XXX functions).

tolerance

numeric with maximum tolerance between a number and its successor.

Value

The same data frame but without peaks.

Examples

1
2
3
4
5
6
7
8
# Relative path to raw data
full_path <- system.file('extdata', package = "hydroToolkit")

# Read IANIGLA file
cuevas <- read_IANIGLA(file = 'Cuevas.csv', path = full_path)             

# Remove spikes from air temperature series
tair_rm_spikes <- rm_spikes(df = cuevas, tolerance = 10)

hydroToolkit documentation built on July 2, 2020, 1:04 a.m.