Title: | Analysis of Feedback in Time Series |
---|---|
Description: | Analysis of fragmented time directionality to investigate feedback in time series. Tools provided by the package allow the analysis of feedback for a single time series and the analysis of feedback for a set of time series collected across a spatial domain. |
Authors: | Samuel Soubeyrand, Cindy E. Morris, E. Keith Bigg |
Maintainer: | Samuel Soubeyrand <[email protected]> |
License: | GPL (>= 2.0) |
Version: | 1.5 |
Built: | 2024-11-08 06:14:46 UTC |
Source: | https://github.com/cran/FeedbackTS |
Analysis of fragmented time directionality to investigate feedbacks in time series. Tools provided by the package allow the analysis of feedback for a single time series and the analysis of feedback for a set of time series collected across a spatial domain.
Package: | FeedbackTS |
Type: | Package |
Version: | 1.5 |
Date: | 2020-01-22 |
License: | GPL (>=2.0) |
Depends: | methods, maps, mapdata, proj4, sp, gstat, automap, date |
To analyze feedback in a single time series create a KDD object (Key Day Dataset) with the construction function kdd.from.raw.data and test fragmented time directionality with the function feedback.test.
To analyze the spatial pattern of feedback from a set of time series collected across a spatial domain, create indices of feedback with the function feedback.stats, map the index with map.statistic, krige the index with krige and test spatial variation in feedback with krige.test.
Samuel Soubeyrand, Cindy E. Morris, E. Keith Bigg
Maintainer: Samuel Soubeyrand [email protected]
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.
#### load library ## Not run: library(FeedbackTS) #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] ######## ANALYSIS OF FEEDBACK WITH A SINGLE TIME SERIES #### 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) #### test feedback and change in feedback with a single data series ## using the thresholded data series ## using difference of means of positive indicator values (i.e. rainfall occurrence) ## computer intensive stage ## Not run: par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) feedback.test(object=KDD, test="feedback", operator="dmpiv", nb.rand=10^3, plots=TRUE) ## End(Not run) ######## ANALYSIS OF FEEDBACK WITH A SET OF TIME SERIES COLLECTED ACROSS SPACE #### map of feedback index computed from the whole data series par(mfrow=c(1,1), mar=c(0,0,0,0)) stat1=rain.feedback.stats[["Feedback.whole.period"]] map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback") #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
#### load library ## Not run: library(FeedbackTS) #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] ######## ANALYSIS OF FEEDBACK WITH A SINGLE TIME SERIES #### 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) #### test feedback and change in feedback with a single data series ## using the thresholded data series ## using difference of means of positive indicator values (i.e. rainfall occurrence) ## computer intensive stage ## Not run: par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) feedback.test(object=KDD, test="feedback", operator="dmpiv", nb.rand=10^3, plots=TRUE) ## End(Not run) ######## ANALYSIS OF FEEDBACK WITH A SET OF TIME SERIES COLLECTED ACROSS SPACE #### map of feedback index computed from the whole data series par(mfrow=c(1,1), mar=c(0,0,0,0)) stat1=rain.feedback.stats[["Feedback.whole.period"]] map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback") #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
Computation of after-before differences around key days using using data days before and after each key day.
after.minus.before(data, operator)
after.minus.before(data, operator)
data |
either a KDD object, a KDD.yearly.average object, or a matrix with an odd number of rows corresponding built as the |
operator |
a character string specifying the transformation of the raw values, must be one of |
If operator = "dmv"
(difference of mean values), the raw values of the time series are used to compute the difference:
where is the date of the key day,
is the number of days considered after and before the key day (specified when
data
is provided).
If operator = "dmpiv"
(difference of means of positive indicator values), the raw values are used to compute the difference:
where is the indicator function.
If operator = "dmgiv"
(difference of means of greater indicator values), the raw values are used to compute the difference:
A numeric vector providing for each key day the value of the after-before difference.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
KDD, KDD.yearly.average, kdd.from.raw.data, rain.site.6008
#### 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) #### compute and plot after-before differences of KDD par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,4.1)) ## using option dmpiv (difference of means of positive indicator values) amb1=after.minus.before(KDD,"dmpiv") plot(KDD["day"],amb1,type="l",xlab="Day",ylab="After-Before") abline(h=0,lty="dashed",col="grey") plot(KDD["day"],cumsum(amb1),type="l",xlab="Day",ylab="Cumul After-Before") abline(h=0,lty="dashed",col="grey") ## using option dmv (difference of means of values) amb2=after.minus.before(KDD,"dmv") plot(KDD["day"],amb2,type="l",xlab="Day",ylab="After-Before") abline(h=0,lty="dashed",col="grey") plot(KDD["day"],cumsum(amb2),type="l",xlab="Day",ylab="Cumul After-Before") abline(h=0,lty="dashed",col="grey")
#### 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) #### compute and plot after-before differences of KDD par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,4.1)) ## using option dmpiv (difference of means of positive indicator values) amb1=after.minus.before(KDD,"dmpiv") plot(KDD["day"],amb1,type="l",xlab="Day",ylab="After-Before") abline(h=0,lty="dashed",col="grey") plot(KDD["day"],cumsum(amb1),type="l",xlab="Day",ylab="Cumul After-Before") abline(h=0,lty="dashed",col="grey") ## using option dmv (difference of means of values) amb2=after.minus.before(KDD,"dmv") plot(KDD["day"],amb2,type="l",xlab="Day",ylab="After-Before") abline(h=0,lty="dashed",col="grey") plot(KDD["day"],cumsum(amb2),type="l",xlab="Day",ylab="Cumul After-Before") abline(h=0,lty="dashed",col="grey")
Computation of temporal averages of after-before differences around key days calculated from a time series and computation of the difference in the temporal averages around a turning point in time.
feedback.stats(object, operator, turning.year = NULL, trend.correction = list( apply = FALSE , object2 = NULL ))
feedback.stats(object, operator, turning.year = NULL, trend.correction = list( apply = FALSE , object2 = NULL ))
object |
either a KDD object or a KDD.yearly.average object. |
operator |
a character string specifying the transformation of the raw values, must be one of |
turning.year |
an optional numeric vector of years used to specify turning points in the data series. |
trend.correction |
an optional list of two items: the |
The function computes the following temporal averages of after-before differences around key days calculated from a time series:
where is a set of key days,
is the number of key days in
, and
is an after-before difference computed for each key day
(see below and in after.minus.before function).
If operator = "dmv"
(difference of mean values), the raw values of the time series are used to compute the difference:
where is the date of the key day,
is the number of days considered around the key day (specified when
data
is provided).
If operator = "dmpiv"
(difference of means of positive indicator values), the raw values are used to compute the difference:
where is the indicator function.
If operator = "dmgiv"
(difference of means of greater indicator values), the raw values are used to compute the difference:
If turning.year = NULL
, the function computes
where
is the set of all key days in the whole time series.
If turning.year
is a numeric vector, for each value in
turning.year
the function computes with
equal to the set of key days in the whole time series, in the time
series before
and in the time series after
. The function
also computes, for each value
, the difference between the
temporal averages of after-before differences after
and before
.
If trend.correction$apply = TRUE
, a trend correction is applied
to take into account, for example, seasonal effect in the time series
(see Morris et al., 2016).
If turning.year = NULL
, a numeric equal to the temporal average of after-before differences around key days calculated from the whole time series.
If turning.year
is a numeric vector, a numeric vector providing:
the temporal average of after-before differences around key days calculated from the whole time series;
for each value in
turning.year
,
the temporal average of after-before differences around key days calculated from the time series right-truncated at time
;
the temporal average of after-before differences around key days calculated from the time series left-truncated at time
;
the difference .
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
Morris, C.E., Soubeyrand, S.; Bigg, E.K., Creamean, J.M., Sands, D.C. (2016). Rainfall feedback maps: a tool to depict the geography of precipitation's sensitivity to aerosols. INRA Research Report.
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.
KDD, KDD.yearly.average, kdd.from.raw.data, after.minus.before, rain.site.6008, rain.feedback.stats
#### 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) #### main feedback statistic feedback.stats(KDD, "dmv") #### main and auxiliary feedback statistics feedback.stats(KDD, "dmv", turning.year=c(1960,1980)) #### apply a trend correction ## define the KDD object used for trend correction (it is defined as ## KDD above except that the threshold value is equal to 0) KDD2=kdd.from.raw.data(raw.data=rain.site.6008, keyday.threshold=0, nb.days=20, col.series=5, col.date=c(2,3,4), na.rm=TRUE, filter=NULL) ## compute the statistic feedback.stats(KDD, "dmv", trend.correction=list(apply=TRUE, object2=KDD2))
#### 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) #### main feedback statistic feedback.stats(KDD, "dmv") #### main and auxiliary feedback statistics feedback.stats(KDD, "dmv", turning.year=c(1960,1980)) #### apply a trend correction ## define the KDD object used for trend correction (it is defined as ## KDD above except that the threshold value is equal to 0) KDD2=kdd.from.raw.data(raw.data=rain.site.6008, keyday.threshold=0, nb.days=20, col.series=5, col.date=c(2,3,4), na.rm=TRUE, filter=NULL) ## compute the statistic feedback.stats(KDD, "dmv", trend.correction=list(apply=TRUE, object2=KDD2))
Randomization test to investigate the fragmented time directionality in a single time series and the temporal variation in the fragmented time directionality.
feedback.test(object, test, operator, nb.rand, plots = TRUE, turning.year = NULL)
feedback.test(object, test, operator, nb.rand, plots = TRUE, turning.year = NULL)
object |
either a KDD object or a KDD.yearly.average object. |
test |
a character string specifying the type of test, must be one of |
operator |
a character string specifying the transformation of the raw values, must be one of |
nb.rand |
a positive integer specifying the number of randomizations. |
plots |
a logical indicating if plots characterizing the test are produced (if |
turning.year |
an optional numeric value specifying a temporal turning point in the data series, must be provided if |
If plots = TRUE
, two plots are produced. The first plot gives the cumulative after-before difference (CABD; red curve) and for each CABD value the quantiles of order 0.025 (bottom dotted curve), 0.25 (bottom dashed curve), 0.5 (solid black curve), 0.75 (top dashed curve) and 0.975 (top dotted curve) under the null hypothesis that is tested (either no feedback or no change-in-feedback). The second plot gives the number of exits of the CABD function from the confidence intervals (red line) and the distribution of the number of exits under the null hypothesis that is tested (histogram).
A numeric value providing the p-value of the test.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
KDD, KDD.yearly.average, kdd.from.raw.data, after.minus.before, rain.site.6008
#### 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) #### test feedback and change in feedback with a single data series ## using the thresholded data series ## using difference of means of positive indicator values (i.e. rainfall occurrence) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) feedback.test(object=KDD, test="feedback", operator="dmpiv", nb.rand=10^3, plots=TRUE)
#### 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) #### test feedback and change in feedback with a single data series ## using the thresholded data series ## using difference of means of positive indicator values (i.e. rainfall occurrence) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) feedback.test(object=KDD, test="feedback", operator="dmpiv", nb.rand=10^3, plots=TRUE)
Build a KDD (Key Day Dataset) object directly from values of the slots of the KDD class.
kdd(before.after, date, year, day, keyday.threshold)
kdd(before.after, date, year, day, keyday.threshold)
before.after |
a matrix with |
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 |
an object from the KDD class.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
KDD, kdd.from.raw.data, rain.site.6008
#### 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([email protected],date=KDD@date,year=KDD@year, day=KDD@day-100,[email protected]) #### simplest alternative KDD2=KDD KDD2["day"]=KDD2["day"]-100
#### 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
"KDD"
Class KDD (Key Day Dataset) used as argument in FeedbackTS
functions for the analysis of fragmented time directionality and feedback.
Objects can be created by calls of the form new("KDD", ...)
, kdd.from.raw.data(...) and kdd(...).
before.after
:Object of class "matrix"
with rows
and
columns: Each column gives the raw values
of the time series, where
is the date of the key day,
is the number of days considered after and before the key day,
is the number of key days in the data series (depends on
keyday.threshold
).
date
:Object of class "character"
, vector of size providing the dates of the key days in format yyyy.mm.dd.
year
:Object of class "numeric"
, vector of size providing the years during which the key days occurred.
day
:Object of class "numeric"
, vector of size providing for each key day the number of days since the beginning of the data series.
keyday.threshold
:Object of class "numeric"
providing the threshold value above which a day is considered as a key day (i.e. if
keyday.threshold
, then day is a key day).
signature(x = "KDD", i = "ANY", j = "ANY", value =
"ANY")
: Change one of the slots.
signature(x = "KDD")
: Extract one of the slots.
signature(x = "KDD")
: Prints slot names.
signature(object = "KDD")
: Prints all slots of
the KDD object.
signature(object = "KDD")
: Prints summary
characteristics of the KDD object.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
kdd, kdd.from.raw.data, KDD.yearly.average, rain.site.6008
showClass("KDD") #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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) ## summary of the object summary(KDD) ## names of the object names(KDD) slotNames(KDD) ## show attributes of the object KDD["before.after"][,1:5] KDD["date"] KDD["keyday.threshold"] ## change keyday threshold KDD["keyday.threshold"]=50
showClass("KDD") #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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) ## summary of the object summary(KDD) ## names of the object names(KDD) slotNames(KDD) ## show attributes of the object KDD["before.after"][,1:5] KDD["date"] KDD["keyday.threshold"] ## change keyday threshold KDD["keyday.threshold"]=50
Build a KDD (Key Day Dataset) object from a matrix or a data frame containing a time series and other attributes.
kdd.from.raw.data(raw.data, keyday.threshold, nb.days, col.series, col.date, na.rm = TRUE, filter = NULL)
kdd.from.raw.data(raw.data, keyday.threshold, nb.days, col.series, col.date, na.rm = TRUE, filter = NULL)
raw.data |
a data frame or a matrix containing raw data. |
keyday.threshold |
a numeric providing the threshold value above which a day is considered as a key day (i.e. if the value |
nb.days |
an integer specifying the number of days considered after and before each key day. |
col.series |
an integer specifying the number of the column containing the time series. |
col.date |
an integer vector of size three specifying the numbers of the columns containing the vector of years, the vector of months and the vector of days in numeric format. |
na.rm |
a logical indicating whether key days |
filter |
a list of lists specifying the filters to carry out over the time series (default is |
The filter
argument is a list of lists, each list having the following arguments:
apply.over
:a character string that must be one of "keyday" or "range", and that indicates whether the filter concerns only the key days or also the range of days considered around the key days ( days before and
days after each key day).
column
:an integer specifying the column of raw.data
which the filter is applied to.
value
:a value that must be taken by the variable determined by the argument column
.
Let denote a key day. Let
denote the value, at day
, of the variable determined by the argument
column
. If apply.over = "keyday"
and =
value
, then key day is kept, otherwise it is discarded. If
apply.over = "range"
and =
value
for all , then key day
is kept, otherwise it is discarded.
an object from the KDD class.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
#### 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) summary(KDD) #### build KDD objects from raw data (site 6008: Callagiddy station) ## using a threshold value equal to 25 ## using filters rain.site.6008b=cbind(rain.site.6008,rain.site.6008[["Year"]]>=1960) KDD2=kdd.from.raw.data(raw.data=rain.site.6008b,keyday.threshold=25,nb.days=20, col.series=5,col.date=c(2,3,4),na.rm=TRUE, filter=list(list(apply.over="range",column=6,value=TRUE))) summary(KDD2)
#### 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) summary(KDD) #### build KDD objects from raw data (site 6008: Callagiddy station) ## using a threshold value equal to 25 ## using filters rain.site.6008b=cbind(rain.site.6008,rain.site.6008[["Year"]]>=1960) KDD2=kdd.from.raw.data(raw.data=rain.site.6008b,keyday.threshold=25,nb.days=20, col.series=5,col.date=c(2,3,4),na.rm=TRUE, filter=list(list(apply.over="range",column=6,value=TRUE))) summary(KDD2)
Build a KDD.yearly.average (yearly average of a Key Day Dataset) by averaging on a yearly basis a KDD object
kdd.yearly.average(object)
kdd.yearly.average(object)
object |
an object from the KDD class. |
an object from the KDD.yearly.average class.
The before.after
matrix of the KDD object is averaged on a yearly basis: every group of columns corresponding to a single year is averaged into a single column.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
KDD.yearly.average, KDD, kdd.from.raw.data, rain.site.6008
#### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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 the yearly average of KDD KDD2=kdd.yearly.average(KDD) ## summary of the object summary(KDD2)
#### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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 the yearly average of KDD KDD2=kdd.yearly.average(KDD) ## summary of the object summary(KDD2)
"KDD.yearly.average"
Class KDD.yearly.average (yearly average of a Key Day Dataset) used as argument in FeedbackTS
functions for the analysis of fragmented time directionality and feedback.
Objects can be created by calls of the form new("KDD.yearly.average", ...)
and kdd.yearly.average(...).
before.after
:Object of class "matrix"
with rows
and
columns: Each column gives the yearly average of the vectors of raw values
of the time series for key days
occurring during a single year (
is the number of days considered after and before the key day,
is the number of years with key days in the data series and depends on
keyday.threshold
).
year
:Object of class "numeric"
, vector of size providing the years during which the key days occurred.
keyday.threshold
:Object of class "numeric"
providing the threshold value above which a day is considered as a key day (i.e. if
keyday.threshold
, then day is a key day).
yearly.nb.keydays
:Object of class "numeric"
, vector of size providing the number of key days at each year of the slot
year
.
signature(x = "KDD.yearly.average")
: Extract one of the slots.
signature(x = "KDD.yearly.average")
: Prints slot names.
signature(object = "KDD.yearly.average")
: Prints all slots of the KDD object.
signature(object = "KDD.yearly.average")
: Prints summary characteristics of the KDD object.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
KDD.yearly.average, KDD, kdd.from.raw.data, rain.site.6008
showClass("KDD.yearly.average") #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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 the yearly average of KDD KDD2=kdd.yearly.average(KDD) ## summary of the object summary(KDD2) ## names of the object names(KDD2) slotNames(KDD2) ## show attributes of the object KDD2["before.after"][,1:5] KDD2["year"] KDD2["keyday.threshold"]
showClass("KDD.yearly.average") #### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build a KDD object 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 the yearly average of KDD KDD2=kdd.yearly.average(KDD) ## summary of the object summary(KDD2) ## names of the object names(KDD2) slotNames(KDD2) ## show attributes of the object KDD2["before.after"][,1:5] KDD2["year"] KDD2["keyday.threshold"]
Variogram analysis and kriging prediction used to analyze feedback and
change-in-feedback across space. This function is
grounded on the function autoKrige
in the automap
package, grounded itself on the gstat
package.
krige(coordinates, statistic, grid, krige.param=NULL, plots=TRUE, variog.param=list(npoints=50,nsim=99,plot.numbers=0.04))
krige(coordinates, statistic, grid, krige.param=NULL, plots=TRUE, variog.param=list(npoints=50,nsim=99,plot.numbers=0.04))
coordinates |
a 2-column matrix with latitudes and longitudes of observation sites. |
statistic |
a numeric vector specifying the values, at observation sites, of the statistic to be predicted. |
grid |
a list of arguments defining the grid over which the statistic is predicted:
|
krige.param |
a character string equal either to "x+y", "x" or "y" indicating whether the coordinates (and which coordinates) have to be accounted for in the trend in universal kriging; default is NULL, indicating that ordinary kriging without trend is performed. |
plots |
a logical indicating if plots characterizing the variogram analysis and the kriging prediction are produced (if |
variog.param |
a list of arguments used to display the variography, :
|
If plots = TRUE
, four plots are produced. Plot 1:
Estimation of the semivariogram of the statistic (dots: sample
semivariogram; solid curve: theoretical semivariogram; dashed
curves: Monte-Carlo envelopes. Plot 2: Boxplots of kriging prediction (left) and kriging standard error (right). Plot 3: Kriging prediction. Plot 4: Kriging standard error.
a list of items characterizing the variogram analysis and the kriging prediction:
input |
the list of arguments in the call of the |
MAP |
a list allowing to draw the border of the study region that can be made of several polygons. This is the output of the function |
grid |
a 2-column matrix providing the coordinates (in degrees) of the nodes of the prediction locations. |
in.region |
a logical vector indicating, for each grid node whose coordinates are given in the 2-column matrix |
krige |
a list providing the result the variography and the spatial prediction. This is the output of the function |
The krige
function uses some of the functionalities of
the map
function in the maps
package, and of a few
functions in the gstat
and automap
package. To
fully exploit the functionalities of these external functions
(in particular autoKrige
), the krige
function should be extended.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
rain.feedback.stats
, map
in the maps
package, autoKrige
and autofitVariogram
in the automap
package
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### feedback index stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,4.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## the plot style from the \code{automap} package can be obtained as follows: plot(kr1$krige) ## End(Not run)
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### feedback index stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,4.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## the plot style from the \code{automap} package can be obtained as follows: plot(kr1$krige) ## End(Not run)
Randomization test to investigate spatial variation in a kriged index.
krige.test(krige.output, subregion, alternative, nb.rand, subregion.coverage=0.8)
krige.test(krige.output, subregion, alternative, nb.rand, subregion.coverage=0.8)
krige.output |
a list of items corresponding to the output of the krige function. |
subregion |
a list of two vectors containing the lat/long coordinates of the vertices of a polygon. The polygon defines a subregion where one supposes variation in the predicted index
|
alternative |
a character string specifying the alternative hypothesis, must be one of "greater" or "less". |
nb.rand |
a positive integer specifying the number of randomizations (here, a randomization is a random translation on a torus). |
subregion.coverage |
a numeric value between zero and one specifying a criterion to accept a random translation (see Details). Default value is 0.8. |
The criterion to accept a random translation is a minimum coverage of subregion
by the translated grid: the ratio between the number of nodes of the translated grid that are contained in subregion
and the number of nodes of the original grid that are contained in subregion
must be equal to or greater than subregion.coverage
.
an object from the KT.output class
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
krige, KT.output-class, rain.feedback.stats
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### map of feedback index computed from the whole data series stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### map of feedback index computed from the whole data series stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## computer intensive stage ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
"KT.output"
Output of the krige.test function.
Objects are created by calls of the krige.test function.
krige.output
:Object of class "list"
, output of the krige function.
subregion
:Object of class "list"
, two vectors x
and y
containing the latitudes and the longitudes, respectively, of the vertices of a polygon. The polygon defines a subregion where one supposes variation in the predicted index.
averageKrigingPrediction.rand
:Object of class "numeric"
specifying the averages of the kriging predictions in subregion
obtained with randomized data (here, a randomization is a random translation on a torus).
averageKrigingPrediction.obs
:Object of class "numeric"
specifying the average of the kriging prediction in subregion
obtained with observed data.
alternative
:Object of class "character"
, "greater" or "less".
p.value
:Object of class "numeric"
, p-value of the test.
signature(x = "KT.output", i = "ANY", j = "ANY", value = "ANY")
signature(x = "KT.output")
: Extract one of the slots.
signature(x = "KT.output")
: Prints slot names.
signature(object = "KT.output")
: Prints all slots of
the KDD object.
signature(object = "KT.output")
: Prints summary
characteristics of the KDD object.
signature(x = "KT.output"), i="ANY"
: Graphically displays contents of the object.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
showClass("KT.output") #### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### map of feedback index computed from the whole data series stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
showClass("KT.output") #### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites coord=rain.feedback.stats[,3:4] #### map of feedback index computed from the whole data series stat1=rain.feedback.stats[["Feedback.whole.period"]] #### variogram analysis and kriging of feedback index ## Not run: par(mfrow=c(2,2), mar=c(5.1,4.1,4.1,2.1)) kr1=krige(coordinates=coord, statistic=stat1, grid=list(x=seq(110,155,0.25),y=seq(-45,-11,0.25),border="Australia", proj="+proj=lcc +lat_1=-18 +lat_2=-36 +lat0=-25 +lon_0=140",degrees=TRUE), plots=TRUE) ## End(Not run) #### test spatial variation in feedback index and plot test output ## computer intensive stage ## Not run: kt1=krige.test(krige.output=kr1,subregion=list(x=c(138,152,152,138),y=-c(40,40,33,33)), alternative="greater", nb.rand=2000) par(mfrow=c(1,2), mar=c(5.1,4.1,4.1,2.1)) plot(kt1,digits=list(predict=3,pvalue=3),breaks=12) ## End(Not run)
Mapping of a spatial index with circles whose sizes and colors vary with the values of the index
map.statistic(coordinates, statistic, region, cex.circles = c(3, 0.2), legend, main = NULL, add = FALSE)
map.statistic(coordinates, statistic, region, cex.circles = c(3, 0.2), legend, main = NULL, add = FALSE)
coordinates |
a 2-column matrix with latitudes and longitudes of observation sites. |
statistic |
a numeric vector specifying the values, at observation sites, of the index to be mapped. |
region |
a list of arguments defining the region over which the index is mapped:
|
cex.circles |
a numeric vector specifying the circle expansion. |
legend |
a list of arguments defining the location of the legend in the plot:
|
main |
a character string providing an overall title for the plot. |
add |
a logical indicating whteher the plot must be added to a current plot (if |
a plot.
Samuel Soubeyrand [email protected], Cindy E. Morris, E. Keith Bigg.
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.
map.statistic rain.feedback.stats.
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites and corresponding feedback index #### computed from the whole data series coord=rain.feedback.stats[,3:4] stat1=rain.feedback.stats[["Feedback.whole.period"]] #### map of feedback index map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback")
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites and corresponding feedback index #### computed from the whole data series coord=rain.feedback.stats[,3:4] stat1=rain.feedback.stats[["Feedback.whole.period"]] #### map of feedback index map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback")
Feedback and change-in-feedback statistics based on 88 rainfall data series colllected in 88 sites across Australia.
data(rain.feedback.stats)
data(rain.feedback.stats)
A data frame with 88 observations on the following 8 variables.
Station.number
:a numeric vector providing the identifiers of the meteorological stations.
Keyday.threshold
:a numeric vector providing for each meteorological station the threshold value above which a day is considered as a key day.
Longitude
:a numeric vector with longitudes of the meteorological stations.
Latitude
:a numeric vector with latitudes of the meteorological stations.
Feedback.whole.period
:a numeric vector providing for each meteorological station the temporal average of after-before differences around key days calculated from the whole time series.
Feedback.before.1960
:a numeric vector providing for each meteorological station the temporal average of after-before differences around key days calculated from the time series right-truncated in 1960 (data from year 1960 were excluded).
Feedback.after.or.in.1960
:a numeric vector providing for each meteorological station the temporal average of after-before differences around key days calculated from the time series left-truncated in 1960 (data from year 1960 were kept).
Change.in.feedback
:a numeric vector providing the difference between Feedback.after.or.in.1960
and Feedback.before.1960
.
The statistics in this data set were computed using the feedback.stats function.
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.
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.
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites and corresponding feedback index #### computed from the whole data series coord=rain.feedback.stats[,3:4] stat1=rain.feedback.stats[["Feedback.whole.period"]] #### map of feedback index map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback")
#### load data of feedback and change-in-feedback indices in 88 sites across Australia data(rain.feedback.stats) #### spatial coordinates of the 88 sites and corresponding feedback index #### computed from the whole data series coord=rain.feedback.stats[,3:4] stat1=rain.feedback.stats[["Feedback.whole.period"]] #### map of feedback index map.statistic(coord,stat1,cex.circles=c(3,0.2), region=list(border="Australia",xlim=c(110,155)), legend=list(x=c(rep(114,3),rep(123,2)),y=-c(37,39.5,42,37,39.5), xtext=c(rep(114,3),rep(123,2))+1,ytext=-c(37,39.5,42,37,39.5),digits=2), main="Feedback")
Rainfall data at Callagiddy station in Western Australia (meteorological station with identifier 6008).
data(rain.site.6008)
data(rain.site.6008)
A data frame with 36615 observations on the following 5 variables.
Station.Number
a numeric vector providing the identifier of the meteorological station.
Year
a numeric vector specifying the year of each observation.
Month
a numeric vector specifying the month in the year of each observation.
Day
a numeric vector specifying the day in the month of each observation.
Precipitation.in.the.24.hours.before.9am..local.time..in.mm
a numeric vector providing the precipitation level in the 24 hours before 9am, local time, in mm.
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.
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.
#### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build KDD object from raw data (site 6008: Callagiddy station) ## using a threshold value equal to 0 to keep all days KDDno=kdd.from.raw.data(raw.data=rain.site.6008,keyday.threshold=0,nb.days=20, col.series=5,col.date=c(2,3,4),na.rm=TRUE,filter=NULL) #### compute after-before differences and plot the whole data series plot(KDDno["day"],KDDno["before.after"][21,],type="l",xlab="Day",ylab="Daily rainfall") axis(3,at=c(1,365*30,365*60,365*90),labels=KDDno["year"][1]+c(0,30,60,90))
#### load data for site 6008 (Callagiddy station) data(rain.site.6008) #### build KDD object from raw data (site 6008: Callagiddy station) ## using a threshold value equal to 0 to keep all days KDDno=kdd.from.raw.data(raw.data=rain.site.6008,keyday.threshold=0,nb.days=20, col.series=5,col.date=c(2,3,4),na.rm=TRUE,filter=NULL) #### compute after-before differences and plot the whole data series plot(KDDno["day"],KDDno["before.after"][21,],type="l",xlab="Day",ylab="Daily rainfall") axis(3,at=c(1,365*30,365*60,365*90),labels=KDDno["year"][1]+c(0,30,60,90))