get_phases: S3 Generic for class phases

Description Usage Arguments Value See Also Examples

View source: R/get_phases.R

Description

get_phases method for getting the phasal data according to the specified type arguments (peaks or v_points). By default, the phases are derived according to v_points. see ?phases, the constructor function for the class phases.

Usage

1
2
3
4
5
6
7
get_phases(x, ...)

## Default S3 method:
get_phases(x, ...)

## S3 method for class 'phases'
get_phases(x, ...)

Arguments

x

Either a numeric vector or an object of class phases.

...

further arguments passed to the class constructor function phases. Ignored when x is of class phases

Value

A list containing the phasal data.

See Also

phases

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
nam<- seq.Date(from = as.Date('2016-01-01'), to = as.Date ('2018-12-31'), by = 16)
dy11 <- c(1.40, 1.00, 1.50, 2.00, 5.00, 3.00, 1.00, 0.76, 2.00, 1.00, 3.50, 3.00, 1.50)
dy12 <- c(1.30, 1.10, 1.40, 2.01, 5.50, 2.80, 1.01, 1, 2.03, 1.09, 3.10, 3.00, 1.50)
dy1 <- c(dy11, dy12)
names(dy1) <- nam[1:length(dy1)]

## dispatches on the get_phases.default when x is the raw numeric vector
get_phases (dy1, ts_freq = 12)

## dispatches on the get_phases.phases when x is of class phases.
y <- phases(dy1, ts_freq = 12)
get_phases (y)

Issoufou-Liman/growingSeason documentation built on Jan. 23, 2020, 3:43 a.m.