seasonality_and_colour: Seasonality and colour of environmental noise

Description Usage Arguments Value Author(s) See Also Examples

View source: R/seasonality_and_colour.R

Description

Calculates seasonality and colour of environmental noise.

Usage

1
2
3
4
5
6
7
8
9
seasonality_and_colour(
  time_series,
  dates,
  delta,
  is_uneven = FALSE,
  interpolate = FALSE,
  show_warns = TRUE,
  noise_method
)

Arguments

time_series

A numeric vector containing a raw environmental time series.

dates

An vector of class Date of format YYYY-MM-DD (must be in progressive chronological order).

delta

Time interval (any unit) of time_series.

is_uneven

Is time_series even or unevenly distributed in time? Default is FALSE.

interpolate

Should a linear interpolation be applied to missing values in time_series? Irrelevant method if is_uneven is FALSE. Default is FALSE.

show_warns

Should cautionary warning messages be displayed? Default is TRUE. Strongly recommended for first time users.

noise_method

A method for estimating the slope theta. Takes 2 possible values: 'spectrum' for evenly distributed time series or 'lomb_scargle' for unevenly distributed ones.

Value

A data.frame.

Author(s)

Diego Barneche and Scott Burgess.

See Also

env_stats, seasonality_calc, noise_calc.

Examples

 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
library(envPred)
data(sst)
# all results return important
# warning messages of which the user should be aware.
# after double-checking that the data falls
# within the recommended specs, set show_warns = FALSE
fct <- envPred:::seasonality_and_colour
fct(sst$time_series,
    sst$dates,
    delta = 1,
    is_uneven = FALSE,
    interpolate = FALSE,
    show_warns = TRUE,
    noise_method = 'spectrum')
fct(sst$time_series,
    sst$dates,
    delta = 1,
    is_uneven = FALSE,
    interpolate = FALSE,
    show_warns = TRUE,
    noise_method = 'spectrum')
fct(sst$time_series,
    sst$dates,
    delta = 1,
    is_uneven = FALSE,
    interpolate = FALSE,
    show_warns = TRUE,
    noise_method = 'spectrum')
data(npp)
fct(npp$time_series,
    npp$dates,
    delta = 8,
    is_uneven = TRUE,
    interpolate = FALSE,
    show_warns = TRUE,
    noise_method = 'lomb_scargle')
fct(npp$time_series,
    npp$dates,
    delta = 8,
    is_uneven = TRUE,
    interpolate = TRUE,
    show_warns = TRUE,
    noise_method = 'lomb_scargle')

dbarneche/envPred documentation built on June 28, 2020, 5:04 p.m.