kdd: Build a KDD object from values of slots

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/KDD.R

Description

Build a KDD (Key Day Dataset) object directly from values of the slots of the KDD class.

Usage

1
kdd(before.after, date, year, day, keyday.threshold)

Arguments

before.after

a matrix with 2\times K+1 rows and n columns: Each column gives the raw values y_{i-K},…,y_{i+K} of the time series, where i is the date of the key day, K is the number of days considered after and before the key day, n is the number of key days in the data series (depends on keyday.threshold).

date

a character vector providing the dates of the key days in format yyyy.mm.dd.

year

a numeric vector providing the years during which the key days occurred.

day

a numeric vector providing for each key day the number of days since the beginning of the data series.

keyday.threshold

a numeric value providing the threshold value above which a day is considered as a key day (i.e. if y_i≥ keyday.threshold, then day i is a key day).

Value

an object from the KDD class.

Author(s)

Samuel Soubeyrand Samuel.Soubeyrand@avignon.inra.fr, Cindy E. Morris, E. Keith Bigg.

References

Soubeyrand, S., Morris, C. E. and Bigg, E. K. (2014). Analysis of fragmented time directionality in time series to elucidate feedbacks in climate data. Environmental Modelling and Software 61: 78-86.

See Also

KDD, kdd.from.raw.data, rain.site.6008

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#### load data for site 6008 (Callagiddy station)
data(rain.site.6008)

#### build KDD objects from raw data (site 6008: Callagiddy station)
## using a threshold value equal to 25
KDD=kdd.from.raw.data(raw.data=rain.site.6008,keyday.threshold=25,nb.days=20,
   col.series=5,col.date=c(2,3,4),na.rm=TRUE,filter=NULL)
	
#### build a new KDD object by modifying one of the slots of KDD
## (e.g. new starting point of the data series)
KDD2=kdd(before.after=KDD@before.after,date=KDD@date,year=KDD@year,
   day=KDD@day-100,keyday.threshold=KDD@keyday.threshold)

#### simplest alternative
KDD2=KDD
KDD2["day"]=KDD2["day"]-100

Example output

Loading required package: maps
Loading required package: mapdata
Loading required package: proj4
Loading required package: sp
Loading required package: geoR
--------------------------------------------------------------
 Analysis of Geostatistical Data
 For an Introduction to geoR go to http://www.leg.ufpr.br/geoR
 geoR version 1.7-5.2.1 (built on 2016-05-02) is now loaded
--------------------------------------------------------------

Warning message:
no DISPLAY variable so Tk is not available 

FeedbackTS documentation built on Jan. 23, 2020, 5:06 p.m.