Function to calculate the main seasonal indexes of the pollen season (Start Date, Peak Date, End Date and Pollen Integral). Trends analysis of the parameters over the seasons. Plots showing the distribution of the main seasonal indexes over the years.
plot_trend(data, interpolation = TRUE, int.method = "lineal",
export.plot = TRUE, export.format = "pdf", export.result = TRUE,
method = "percentage", ...)
A data.frame
object. This data.frame
should include a first column in format Date
and the rest of columns in format numeric
belonging to each pollen type by column.
A logical
value specifying if the visualization shows the gaps in the inputs data (interpolation = FALSE
) or if an interpolation method is used for filling the gaps (interpolation = TRUE
). By default, interpolation = TRUE
.
A character
string with the name of the interpolation method to be used. The implemented methods that may be used are: "lineal"
, "movingmean"
, "tseries"
or "spline"
. By default, int.method = "lineal"
.
A logical
value specifying if a plot will be exported or not. If FALSE
graphical results will only be displayed in the active graphics window. If TRUE
graphical results will be displayed in the active graphics window and also one pdf/png file will be saved within the plot_AeRobiology directory automatically created in the working directory. By default, export.plot = TRUE
.
A character
string specifying the format selected to save the plot. The implemented formats that may be used are: "pdf"
or "png"
. By default, export.format = "pdf"
.
A logical
value. If export.result = TRUE
, a table is exported with the extension .xlsx, in the directory table_AeRobiology. This table has the information about the slope
"beta coefficient of a lineal model using as predictor the year and as dependent variable one of the main pollen season indexes". The information is referred to the main pollen season indexes: Start Date, Peak Date, End Date and Pollen Integral.
A character
string specifying the method applied to calculate the pollen season and the main seasonal parameters. The implemented methods that can be used are: "percentage"
, "logistic"
, "moving"
, "clinical"
or "grains"
. By default, method = "percentage"
(perc = 95
%). A more detailed information about the different methods for defining the pollen season may be consulted in the function calculate_ps
.
Additional arguments for the function calculate_ps
are also accepted.
This function returns several plots in the directory plot_AeRobiology/trend_plots with the extension .pdf or .png.Also produces an object of the class data.frame
and export a table with the extension .xlsx, in the directory table_AeRobiology.
These tables have the information about the slope
(beta coefficient of a lineal model using as predictor the year and as dependent variable one of the main pollen season indexes). The information is referred to the main pollen season indexes: Start Date, Peak Date, End Date and Pollen Integral.
# NOT RUN {
data("munich_pollen")
plot_trend(munich_pollen, interpolation = FALSE, export.plot = FALSE, export.result = TRUE)
# }
Run the code above in your browser using DataLab