plotSeasonTrend(x, first, last, type = c("slope", "slope.pct"), method = c("mk", "lin"), plot = TRUE, miss = FALSE, leg = 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. The results can be shown as a listing, or as a graph in which each time series is represented by a dot plot showing the trend for each season. The colour of the dot indicates whether the trend is significant or not. When method = 'mk'
, the dot shape (solid or empty circle) indicates whether the proportion of slopes joining the first and last fifths of the data is < 0.5 or not. If this value is 0.5 or more, the trend results may not be a good representation of the entire period and a different time window should be considered. Indication of missing values and the graph legend is optional.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
plotSeasonTrend(x, first=1978, last=2009, ncol = 4, scales = 'free_x')
plotSeasonTrend(x, type = 'slope.pct', plot = FALSE)
Run the code above in your browser using DataLab