seasonTrend(x, first, last, type = c("slope", "slope.pct"),
method = c("mk", "lin"), plot = FALSE, xlab = NULL,
ylab = NULL, miss = FALSE, legend = FALSE, ...)
type = "slope.pct"
, the slopes are multiplied by 100 and divided by the overall mean (not the median, which can be zero even in cases where a trend estimate is useful). If method = 'mk'
. the Theil-Sen slope is calculated with the Mann-Kendall test of significance. Otherwise, linear regression is used to determine the slope and significance.If plot = TRUE
, each time series is represented by a box plot showing the trend for each season. The fill colour of the box indicates whether the trend is significant or not (the legend is optional). When method = 'mk'
, the proportion of slopes joining the first and last fifths of the data is calculated. If this value is 0.5 or more, the corresponding trends can be omitted by setting miss = TRUE
; the trend results may not be a good representation of the entire period and a different time window should be considered.
Parameters can be passed to the plotting function, in particular, to facet_wrap
in ncol
(or nrow
), which determines the number of columns (or rows) of plots, and scales
, which can be set to "free_x"
to allow the x-axis to change for each time series.
mannKen
, plotSeason
, facet_wrap
x <- sfbayChla
seasonTrend(x, first=1978, last=2009, ncol = 4, plot = TRUE, legend = TRUE)
seasonTrend(x, type = 'slope.pct')
Run the code above in your browser using DataLab