Title: | A Computational Tool for Aerobiological Data |
---|---|
Description: | Different tools for managing databases of airborne particles, elaborating the main calculations and visualization of results. In a first step, data are checked using tools for quality control and all missing gaps are completed. Then, the main parameters of the pollen season are calculated and represented graphically. Multiple graphical tools are available: pollen calendars, phenological plots, time series, tendencies, interactive plots, abundance plots... |
Authors: | Jesus Rojo <[email protected]>, Antonio Picornell <[email protected]>, Jose Oteros <[email protected]> |
Maintainer: | "Jose Oteros" <[email protected]> |
License: | GPL-3 |
Version: | 2.0.1 |
Built: | 2025-01-29 05:41:22 UTC |
Source: | https://github.com/cran/AeRobiology |
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. Summary dot plot showing the distribution of the main seasonal indexes over the years.
analyse_trend(data, interpolation = TRUE, int.method = "lineal", export.plot = TRUE, export.format = "pdf", export.result = TRUE, method = "percentage", quantil = 0.75, significant = 0.05, split = TRUE, result = "table", ...)
analyse_trend(data, interpolation = TRUE, int.method = "lineal", export.plot = TRUE, export.format = "pdf", export.result = TRUE, method = "percentage", quantil = 0.75, significant = 0.05, split = TRUE, result = "table", ...)
data |
A |
interpolation |
A |
int.method |
A |
export.plot |
A |
export.format |
A |
export.result |
A |
method |
A |
quantil |
A |
significant |
A |
split |
A |
result |
A |
... |
Additional arguments for the function |
This function allows to study time series trends of the pollen season. Even though the package was originally designed to treat aeropalynological data, it can be used to study many other atmospheric components (e.g., bacteria in the air, fungi, insects ...) (Buters et al., 2018; Oteros et al., 2019). The study of trends in pollen time series is a common approach to study the impact of climate change or other environmental factors on vegetation (Galan et al., 2016; Garcia_Mozo et al., 2016; Recio et al., 2018). This tool can also be useful for studying trends in other fields (Oteros et al., 2015).
If result == "plot"
, the function returns a list of objects of class ggplot2; if result == "table"
, the function returns a data.frame with the hourly patterns.
The plot is of the class ggplot2 or a list of plots of the class ggplot2 (depending on the argument split
). This is a combined dot plot showing the trends (slope and p value) of the main seasonal features.
The object of the class data.frame
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.
Buters, J. T. M., Antunes, C., Galveias, A., Bergmann, K. C., Thibaudon, M., Galan, C., ... & Oteros, J. (2018). Pollen and spore monitoring in the world. Clinical and translational allergy, 8(1), 9.
Galan, C., Alcazar, P., Oteros, J., Garcia_Mozo, H., Aira, M. J., Belmonte, J., ... & Perez_Badia, R. (2016). Airborne pollen trends in the Iberian Peninsula. Science of the Total Environment, 550, 53_59.
Garcia_Mozo, H., Oteros, J. A., & Galan, C. (2016). Impact of land cover changes and climate on the main airborne pollen types in Southern Spain. Science of the Total Environment, 548, 221_228.
Oteros, J., Garcia_Mozo, H., Botey, R., Mestre, A., & Galan, C. (2015). Variations in cereal crop phenology in Spain over the last twenty_six years (1986_2012). Climatic Change, 130(4), 545_558.
Oteros, J., Bartusel, E., Alessandrini, F., Nunez, A., Moreno, D. A., Behrendt, H., ... & Buters, J. (2019). Artemisia pollen is the main vector for airborne endotoxin. Journal of Allergy and Clinical Immunology.
Recio, M., Picornell, A., Trigo, M. M., Gharbi, D., Garcia_Sanchez, J., & Cabezudo, B. (2018). Intensity and temporality of airborne Quercus pollen in the southwest Mediterranean area: Correlation with meteorological and phenoclimatic variables, trends and possible adaptation to climate change. Agricultural and Forest Meteorology, 250, 308_318.
data("munich_pollen") analyse_trend(munich_pollen, interpolation = FALSE, export.result = FALSE, export.plot = FALSE)
data("munich_pollen") analyse_trend(munich_pollen, interpolation = FALSE, export.result = FALSE, export.plot = FALSE)
Function to calculate the main parameters of the pollen season with regard to phenology and pollen intensity from a historical database of several pollen types. The function can use the most common methods in the definition of the pollen season.
calculate_ps(data, method = "percentage", th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", interpolation = TRUE, int.method = "lineal", maxdays = 30, result = "table", plot = TRUE, export.plot = FALSE, export.result = FALSE)
calculate_ps(data, method = "percentage", th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", interpolation = TRUE, int.method = "lineal", maxdays = 30, result = "table", plot = TRUE, export.plot = FALSE, export.result = FALSE)
data |
A |
method |
A |
th.day |
A |
perc |
A |
def.season |
A |
reduction |
A |
red.level |
A |
derivative |
A |
man |
A |
th.ma |
A |
n.clinical |
A |
window.clinical |
A |
window.grains |
A |
th.pollen |
A |
th.sum |
A |
type |
A |
interpolation |
A |
int.method |
A |
maxdays |
A |
result |
A |
plot |
A |
export.plot |
A |
export.result |
A |
This function allows to calculate the pollen season using five different methods which are described below. After calculating the start_date, end_date and peak_date for the pollen season all rest of parameters have been calculated as detailed in Value section.
"percentage"
method. This is a commonly used method for defining the pollen season based on the elimination of a certain percentage in the beginning and the end of the pollen season (Nilsson and Persson, 1981; Andersen, 1991). For example if the pollen season is based on the 95% of the total annual pollen ("perc" = 95
), the start_date of the pollen season is marked as the day in which 2.5% of the total pollen is registered and the end_date of the pollen season is marked as the day in which 97.5% of the total pollen is registered.
"logistic"
method. This method was developed by Ribeiro et al. (2007) and modified by Cunha et al. (2015). It is based on fitting annually a non_linear logistic regression model to the daily accumulated curve for each pollen type. This logistic function and the different derivatives were considered to calculate the start_date and end_date of the pollen season, based on the asymptotes when pollen amounts are stabilized on the beginning and the end of the accumulated curve. For more information about the method to see Ribeiro et al. (2007) and Cunha et al. (2015). Three different derivatives may be used (derivative
argument) 4
, 5
or 6
that represent from higher to lower restrictive criterion for defining the pollen season. This method may be complemented with an optional method for reduction the peaks values (reduction = TRUE
), thus avoiding the effect of the great influence of extreme peaks. In this sense, peaks values will be cut below a certain level that the user may select based on a percentile analysis of peaks. For example, red.level = 0.90
will cut all peaks above the percentile 90
.
"moving"
method. This method is proposed the first time by the authors of this package. The definition of the pollen season is based on the application of a moving average to the pollen series in order to obtain the general seasonality of the pollen curve avoiding the great variability of the daily fluctuations. Thus, the start_date and the end_date will be established when the curve of the moving average reaches a given pollen threshold (th.ma
argument). Also the order of the moving average may be customized by the user (man
argument). By default, man
= 11 and th.ma
= 5.
"clinical"
method. This method was proposed by Pfaar et al. (2017). It is based on the expert consensus in relation to pollen exposure and the relationship with allergic symptoms derived of the literature. Different periods may be defined by this method: the pollen season, the high pollen season and the high pollen days. The start_date and end_date of the pollen season were defined as a certain number of days (n.clinical
argument) within a time window period (window.clinical
argument) exceeding a certain pollen threshold (th.pollen
argument) which summation is above a certain pollen sum (th.sum
argument). All these parameters are established for each pollen type according to Pfaar et al. (2017) and using the type
argument these parameters may be automatically adjusted for the specific pollen types ("birch"
, "grasses"
, "cypress"
, "olive"
or "ragweed"
). Furthermore, the user may change all parameters to do a customized definition of the pollen season. The start_date and end_date of the high pollen season were defined as three consecutive days exceeding a certain pollen threshold (th.day
argument). The number of high pollen days will also be calculated exceeding this pollen threshold (th.day
). For more information about the method to see Pfaar et al. (2017).
"grains"
method. This method was proposed by Galan et al. (2001) originally in olive pollen but after also applied in other pollen types. The start_date and end_date of the pollen season were defined as a certain number of days (window.grains
argument) exceeding a certain pollen threshold (th.pollen
argument). For more information about the method to see Galan et al. (2001).
The pollen season of the species may occur during the natural year (Calendar year: from 1. January to 31. December) or the start_date and the end_date of the pollen season may happen in two different natural years (or calendar years). This consideration has been taken into account and in this package different method for defining the period for calculating the pollen season have been implemented. In this sense, the def.season
argument has been incorporated in three options:
"natural"
: considering the pollination year as natural year from 1st January to 31th December for defining the start_dates and end_dates of the pollen season for each pollen types.
"interannual"
: considering the pollination year from 1st June to 31th May for defining the start_dates and end_dates of the pollen season for each pollen types.
"peak"
: considering a customized pollination year for each pollen types calculated as 6 previous months and 6 later months from the average peak_date.
Pollen time series frequently have different gaps with no data and this fact could be a problem for the calculation of specific methods for defining the pollen season even providing incorrect results. In this sense by default a linear interpolation will be carried out to complete these gaps before to define the pollen season (interpolation = TRUE
). Additionally, the users may select other interpolation methods using the int.method
argument, as "lineal"
, "movingmean"
, "spline"
or "tseries"
. For more information to see the interpollen
function.
This function returns different results:data.frame
when result = "table"
including the main parameters of the pollen season with regard to phenology and pollen intensity as:
type: pollen type
seasons: year of the beginning of the season
st.dt: start_date (date)
st.jd: start_date (day of the year)
en.dt: end_date (date)
en.jd: end_date (day of the year)
ln.ps: length of the season
sm.tt: total sum
sm.ps: pollen integral
pk.val: peak value
pk.dt: peak_date (date)
pk.jd: peak_date (day of year)
ln.prpk: length of the pre_peak period
sm.prpk: pollen integral of the pre_peak period
ln.pspk: length of the post_peak period
sm.pspk: pollen integral of the post_peak period
daysth: number of days with more than 100 pollen grains
st.dt.hs: start_date of the High pollen season (date, only for clinical method)
st.jd.hs: start_date of the High pollen season (day of the year, only for clinical method)
en.dt.hs: end_date of the High pollen season (date, only for clinical method)
en.jd.hs: end_date of the High pollen season (day of the year, only for clinical method)
list
when result = "list"
including the main parameters of the pollen season, one pollen type by element
plots
when plot = TRUE
showing graphically the definition of the pollen season for each studied year in the plot history.
If export.result = TRUE
this data.frame
will also be exported as xlsx file within the table_AeRobiology directory created in the working directory. If export.result = FALSE
the results will also be showed as list object named list.ps
.
If export.plot = TRUE
a pdf file for each pollen type showing graphically the definition of the pollen season for each studied year will be saved within the plot_AeRobiology directory created in the working directory.
Andersen, T.B., 1991. A model to predict the beginning of the pollen season. Grana, 30(1), pp.269_275.
Cunha, M., Ribeiro, H., Costa, P. and Abreu, I., 2015. A comparative study of vineyard phenology and pollen metrics extracted from airborne pollen time series. Aerobiologia, 31(1), pp.45_56.
Galan, C., Garcia_Mozo, H., Carinanos, P., Alcazar, P. and Dominguez_Vilches, E., 2001. The role of temperature in the onset of the Olea europaea L. pollen season in southwestern Spain. International Journal of Biometeorology, 45(1), pp.8_12.
Nilsson, S. and Persson, S., 1981. Tree pollen spectra in the Stockholm region (Sweden), 1973_1980. Grana, 20(3), pp.179_182.
Pfaar, O., Bastl, K., Berger, U., Buters, J., Calderon, M.A., Clot, B., Darsow, U., Demoly, P., Durham, S.R., Galan, C., Gehrig, R., Gerth van Wijk, R., Jacobsen, L., Klimek, L., Sofiev, M., Thibaudon, M. and Bergmann, K.C., 2017. Defining pollen exposure times for clinical trials of allergen immunotherapy for pollen_induced rhinoconjunctivitis_an EAACI position paper. Allergy, 72(5), pp.713_722.
Ribeiro, H., Cunha, M. and Abreu, I., 2007. Definition of main pollen season using logistic model. Annals of Agricultural and Environmental Medicine, 14(2), pp.259_264.
data("munich_pollen") calculate_ps(munich_pollen, plot = TRUE, result = "table")
data("munich_pollen") calculate_ps(munich_pollen, plot = TRUE, result = "table")
Function to simultaneously replace all missing data of an historical database of several pollen types by using different methods of interpolation.
interpollen(data, method = "lineal", maxdays = 30, plot = TRUE, factor = 2, ndays = 3, spar = 0.5, data2 = NULL, data3 = NULL, data4 = NULL, data5 = NULL, mincorr = 0.6, result = "wide")
interpollen(data, method = "lineal", maxdays = 30, plot = TRUE, factor = 2, ndays = 3, spar = 0.5, data2 = NULL, data3 = NULL, data4 = NULL, data5 = NULL, mincorr = 0.6, result = "wide")
data |
A |
method |
A |
maxdays |
A |
plot |
A |
factor |
A |
ndays |
A |
spar |
A |
data2 , data3 , data4 , data5
|
A |
mincorr |
A |
result |
A |
This function allows to interpolate missing data in a pollen database using 4 different methods which are described below. Interpolation for each pollen type will be automatically done for gaps smaller than the "maxdays"
argument.
"lineal"
method. The interpolation will be carried out by tracing a straight line between the gap extremes.
"movingmean"
method. It calculates the moving mean of the pollen daily concentrations with a window size of the gap size multiplicated by the factor
argument and replace the missing data with the moving mean for these days. It is a dynamic function and for each gap of the database, the window size of the moving mean changes depending of each gap size.
"spline"
method. The interpolation will be carried out by performing a spline regression with the previous and following days to the gap. The number of days of each side of the gap that will be taken into account for calculating the spline regression are specified by ndays
argument. The smoothness of the adjustment of the spline regression can be specified by the spar
argument.
"tseries"
method. The interpolation will be carried out by analysing the time series of pollen database. It performs a seasonal_trend decomposition based on LOESS (Cleveland et al., 1990). The seasonality of the historical database is extracted and used to predict the missing data by performing a linear regression with the target year.
"neighbour"
method. Other near stations provided by the user are used to interpolate the missing data of the target station. First of all, a Spearman correlation is performed between the target station and the neighbour stations to discard the neighbour stations with a correlation coefficient smaller than mincorr
value. For each gap, a linear regression is performed between the neighbour stations and the target stations to determine the equation which converts the pollen concentrations of the neighbour stations into the pollen concentration of the target station. Only neighbour stations without any missing data during the gap period are taken into account for each gap.
This function returns different results:
If result = "wide"
, returns a data.frame
including the original data and completed with the interpolated data.
If result = "long"
, returns a data.frame
containing your data in long format (the first column for date, the second for pollen type, the third for concentration and an additional fourth column with 1
if this data has been interpolated or 0
if not).
If plot = TRUE
, plots for each year and pollen type with daily values are represented in the active graphic window. Interpolated values are marked in red. If method
argument is "tseries"
, the seasonality is also represented in grey.
Cleveland RB, Cleveland WS, McRae JE, Terpenning I (1990) STL: a seasonal_trend decomposition procedure based on loess. J Off Stat 6(1):3_33.
data("munich_pollen") interpollen(munich_pollen, method = "lineal", plot = FALSE)
data("munich_pollen") interpollen(munich_pollen, method = "lineal", plot = FALSE)
Generates a barplot based on the relative abundance (as percentage) in the air of the pollen types with respect to the total amounts
iplot_abundance(data, n.types = 15, y.start = NULL, y.end = NULL, interpolation = TRUE, int.method = "lineal", col.bar = "#E69F00", type.plot = "static", result = "plot", export.plot = FALSE, export.format = "pdf", exclude = NULL, ...)
iplot_abundance(data, n.types = 15, y.start = NULL, y.end = NULL, interpolation = TRUE, int.method = "lineal", col.bar = "#E69F00", type.plot = "static", result = "plot", export.plot = FALSE, export.format = "pdf", exclude = NULL, ...)
data |
A |
n.types |
A |
y.start , y.end
|
A |
interpolation |
A |
int.method |
A |
col.bar |
A |
type.plot |
A |
result |
A |
export.plot |
A |
export.format |
A |
exclude |
A |
... |
Other additional arguments may be used to customize the exportation of the plots using |
This function allows to calculate the relative abundance of the pollen types in the air from a database and to display a barplot with the percentage representation of the main pollen types as the graph reported by Rojo et al. (2016). This plot will be generated only for the specified number of the most abundant pollen types using the n.types
argument by the user.
Pollen time series frequently have different gaps with no data and this fact could be a problem for the calculation of specific methods for defining the pollen season even providing incorrect results. In this sense by default a linear interpolation will be carried out to complete these gaps before to define the pollen season (interpolation = TRUE
). Additionally, the users may select other interpolation methods using the int.method
argument, as "lineal"
, "movingmean"
, "spline"
or "tseries"
. For more information to see the interpollen
function.
This function returns different results:plot
in the active graphics window displaying the pollen calendar generated by the user when result = "plot"
. This plot
may be included in an object by assignment operators.data.frame
including the yearly average pollen amounts for each pollen types used to generate the pollen of the relative abundance when result = "table"
. This data.frame
will be included in an object named annual.sum.data
.
If export.plot = FALSE
graphical results will only be displayed in the active graphics window as ggplot graph. Additional characteristics may be incorporated to the plot by ggplot
syntax (see ggplot2 package).
If export.plot = TRUE
and export.format = pdf
a pdf file with the plot will be saved within the plot_AeRobiology directory created in the working directory. This option is applicable only for "static"
plots. Additional characteristics may be incorporated to the exportation as pdf file (see grDevices package).
If export.plot = TRUE
and export.format = png
a png file with the plot will be saved within the plot_AeRobiology directory created in the working directory. This option is applicable only for "static"
plots. Additional characteristics may be incorporated to the exportation as png file (see grDevices package).
If type.plot = dynamic
graphical results will be displayed in the active Viewer window as plotly graph. Additional characteristics may be incorporated to the plot by plotly
syntax (see plotly package).
Rojo, J., Rapp, A., Lara, B., Sabariego, S., Fernandez_Gonzalez, F. and Perez_Badia, R., 2016. Characterisation of the airborne pollen spectrum in Guadalajara (central Spain) and estimation of the potential allergy risk. Environmental Monitoring and Assessment, 188(3), p.130.
data("munich_pollen") iplot_abundance (munich_pollen, interpolation = FALSE, export.plot = FALSE)
data("munich_pollen") iplot_abundance (munich_pollen, interpolation = FALSE, export.plot = FALSE)
Generates a boxplot based on phenological parameters (start_dates and end_dates) that are calculated by the estimation of the main parameters of the pollen season
iplot_pheno(data, method = "percentage", n.types = 15, th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", interpolation = TRUE, int.method = "lineal", type.plot = "static", export.plot = FALSE, export.format = "pdf", ...)
iplot_pheno(data, method = "percentage", n.types = 15, th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", interpolation = TRUE, int.method = "lineal", type.plot = "static", export.plot = FALSE, export.format = "pdf", ...)
data |
A |
method |
A |
n.types |
A |
th.day |
A |
perc |
A |
def.season |
A |
reduction |
A |
red.level |
A |
derivative |
A |
man |
A |
th.ma |
A |
n.clinical |
A |
window.clinical |
A |
window.grains |
A |
th.pollen |
A |
th.sum |
A |
type |
A |
interpolation |
A |
int.method |
A |
type.plot |
A |
export.plot |
A |
export.format |
A |
... |
Other additional arguments may be used to customize the exportation of the plots using pdf or png files and therefore arguments from |
This function allows to calculate the pollen season using five different methods which are described in calculate_ps
function. After calculating the start_date and end_date for each pollen type and each year a phenological plot will be generated using the boxplot approach where axis x represents the time (Day of the Year) and axis y includes the considered pollen types. The phenological plot will be generated only for the specified number of the most abundant pollen types using the n.types
argument by the user. The implemented methods for defining the pollen season includes the most commonly used methodologies (Nilsson and Persson, 1981; Andersen, 1991; Galan et al., 2001; Ribeiro et al., 2007; Cunha et al., 2015, Pfaar et al., 2017) and a new implemented method (see calculate_ps
function).
Pollen time series frequently have different gaps with no data and this fact could be a problem for the calculation of specific methods for defining the pollen season even providing incorrect results. In this sense by default a linear interpolation will be carried out to complete these gaps before to define the pollen season (interpolation = TRUE
). Additionally, the users may select other interpolation methods using the int.method
argument, as "lineal"
, "movingmean"
, "spline"
or "tseries"
. For more information to see the interpollen
function.
This function returns different results:
If export.plot = FALSE
graphical results will only be displayed in the active graphics window as ggplot graph. Additional characteristics may be incorporated to the plot by ggplot
syntax (see ggplot2 package).
If export.plot = TRUE
and export.format = pdf
a pdf file of the phenological plot will be saved within the plot_AeRobiology directory created in the working directory. This option is applicable only for "static"
plots. Additional characteristics may be incorporated to the exportation as pdf file (see grDevices package).
If export.plot = TRUE
and export.format = png
a png file of the phenological plot will be saved within the plot_AeRobiology directory created in the working directory. This option is applicable only for "static"
plots. Additional characteristics may be incorporated to the exportation png file (see grDevices package).
If type.plot = dynamic
graphical results will be displayed in the active Viewer window as plotly graph. Additional characteristics may be incorporated to the plot plotly
syntax (see plotly package).
Andersen, T.B., 1991. A model to predict the beginning of the pollen season. Grana, 30(1), pp.269_275.
Cunha, M., Ribeiro, H., Costa, P. and Abreu, I., 2015. A comparative study of vineyard phenology and pollen metrics extracted from airborne pollen time series. Aerobiologia, 31(1), pp.45_56.
Galan, C., Garcia_Mozo, H., Carinanos, P., Alcazar, P. and Dominguez_Vilches, E., 2001. The role of temperature in the onset of the Olea europaea L. pollen season in southwestern Spain. International Journal of Biometeorology, 45(1), pp.8_12.
Nilsson, S. and Persson, S., 1981. Tree pollen spectra in the Stockholm region (Sweden), 1973_1980. Grana, 20(3), pp.179_182.
Pfaar, O., Bastl, K., Berger, U., Buters, J., Calderon, M.A., Clot, B., Darsow, U., Demoly, P., Durham, S.R., Galan, C., Gehrig, R., Gerth van Wijk, R., Jacobsen, L., Klimek, L., Sofiev, M., Thibaudon, M. and Bergmann, K.C., 2017. Defining pollen exposure times for clinical trials of allergen immunotherapy for pollen_induced rhinoconjunctivitis_an EAACI position paper. Allergy, 72(5), pp.713_722.
Ribeiro, H., Cunha, M. and Abreu, I., 2007. Definition of main pollen season using logistic model. Annals of Agricultural and Environmental Medicine, 14(2), pp.259_264.
data("munich_pollen") iplot_pheno (munich_pollen, interpolation = FALSE)
data("munich_pollen") iplot_pheno (munich_pollen, interpolation = FALSE)
Function to plot the pollen data during one season. The plots are fully interactive.
iplot_pollen(data, year)
iplot_pollen(data, year)
data |
A |
year |
An |
An interactive plot of the class ggvis.
data("munich_pollen") iplot_pollen(data = munich_pollen, year = 2012)
data("munich_pollen") iplot_pollen(data = munich_pollen, year = 2012)
Function to plot the pollen data of a pollen type during several seasons. The plots are fully interactive.
iplot_years(data, pollen)
iplot_years(data, pollen)
data |
A |
pollen |
A |
An interactive plot of the class ggvis.
data("munich_pollen") iplot_years(data = munich_pollen, pollen = "Betula")
data("munich_pollen") iplot_years(data = munich_pollen, pollen = "Betula")
Function to calculate the moving average of a given numeric vector. The order of the moving average may be customized by the user (man
argument).
ma(data, man = 10, warnings = FALSE)
ma(data, man = 10, warnings = FALSE)
data |
A |
man |
An |
warnings |
A |
This function returns a vector with the moving average of the input data.
data("munich_pollen") ma(data = munich_pollen$Betula, man = 10, warnings = FALSE)
data("munich_pollen") ma(data = munich_pollen$Betula, man = 10, warnings = FALSE)
A dataset containing information of daily concentrations of pollen in the atmosphere of Munich during the years 2010_2015. Pollen types included: "Alnus", "Betula", "Taxus", "Fraxinus", "Poaceae", "Quercus", "Ulmus" and "Urtica".
munich_pollen
munich_pollen
Time series of daily pollen concentrations expressed as pollen grains / m3 of air.
Data were obtained at Munich (Zentrum Allergie und Umwelt, ZAUM) using a Hirst_type volumetric pollen trap (Hirst, 1952) following the standard methodology (VDI4252_4_2016). Some gaps have been added to test some functions of the package (e.g. quality_control
, interpollen
).
The data were obtained by the research team of Prof. Jeroen Buters (Christine Weil & Ingrid Weichenmeier). We specially acknowledge this team and the Zentrum Allergie und Umwelt (ZAUM, directed by Prof. Carsten B. Schmidt_Weber) for their support.
Hirst, J.M., 1952. AN AUTOMATIC VOLUMETRIC SPORE TRAP. Ann. Appl. Biol. 39, 257_265.
VDI 4252_4. (2016). Bioaerosole und biologische Agenzien_Ermittlung von Pollen und Sporen in der Aussenluft unterVerwendung einer volumetrischen Methode fuer einMessnetz zu allergologischen Zwecken. VDI_Richtlinie4252 Blatt 4, Entwurf. VDI/DIN_Handbuch Reinhaltungder Luft, Band 1a: Beuth, Berlin
Function to plot pollen data expressed in concentrations with time resolution higher than 1 day (e.g. hourly, bi-hourly concentrations). As heatplot.
plot_heathour(data, locations = FALSE, low.col = "blue", mid.col = "white", high.col = "red")
plot_heathour(data, locations = FALSE, low.col = "blue", mid.col = "white", high.col = "red")
data |
A |
locations |
A |
low.col |
A |
mid.col |
A |
high.col |
A |
The function returns an object or a list of objects of class ggplot2.
Oteros, J., Pusch, G., Weichenmeier, I., Heimann, U., Mueller, R., Roeseler, S., ... & Buters, J. T. (2015). Automatic and online pollen monitoring. International archives of allergy and immunology, 167(3), 158-166.
data("POMO_pollen") plot_heathour(POMO_pollen)
data("POMO_pollen") plot_heathour(POMO_pollen)
Function to plot pollen data expressed in concentrations with time resolution higher than 1 day (e.g. hourly, bi-hourly concentrations).
plot_hour(data, result = "plot", locations = FALSE)
plot_hour(data, result = "plot", locations = FALSE)
data |
A |
result |
A |
locations |
A |
If result == "plot"
, the function returns a list of objects of class ggplot2; if result == "table"
, the function returns a data.frame with the hourly patterns.
Oteros, J., Pusch, G., Weichenmeier, I., Heimann, U., Mueller, R., Roeseler, S., ... & Buters, J. T. (2015). Automatic and online pollen monitoring. International archives of allergy and immunology, 167(3), 158-166.
data("POMO_pollen") plot_hour(POMO_pollen, result="plot", locations = FALSE) plot_hour(POMO_pollen, result="plot", locations = TRUE)
data("POMO_pollen") plot_hour(POMO_pollen, result="plot", locations = FALSE) plot_hour(POMO_pollen, result="plot", locations = TRUE)
Function to plot the pollen data amplitude during several seasons: daily average pollen concentration over the study period, maximum pollen concentration of each day over the study period and minimum pollen concentration of each day value over the study period. It is possible to plot the relative abundance per day and smoothing the pollen season by calculating a moving average.
plot_normsummary(data, pollen, mave = 1, normalized = FALSE, interpolation = TRUE, int.method = "lineal", export.plot = FALSE, export.format = "pdf", color.plot = "orange2", axisname = "Pollen grains / m3", ...)
plot_normsummary(data, pollen, mave = 1, normalized = FALSE, interpolation = TRUE, int.method = "lineal", export.plot = FALSE, export.format = "pdf", color.plot = "orange2", axisname = "Pollen grains / m3", ...)
data |
A |
pollen |
A |
mave |
An |
normalized |
A |
interpolation |
A |
int.method |
A |
export.plot |
A |
export.format |
A |
color.plot |
A |
axisname |
A |
... |
Other additional arguments may be used to customize the exportation of the plots using |
This function returns plot of class ggplot2. User are able to customize the output as a ggplot2 object.
data("munich_pollen") plot_normsummary(munich_pollen, pollen = "Betula", interpolation = FALSE, export.plot = FALSE)
data("munich_pollen") plot_normsummary(munich_pollen, pollen = "Betula", interpolation = FALSE, export.plot = FALSE)
Function to plot the main pollen season of a single pollen type.
plot_ps(data, pollen.type = NULL, year = NULL, days = 30, fill.col = "turquoise4", int.method = "lineal", axisname = expression(paste("Pollen grains / m"^"3")), ...)
plot_ps(data, pollen.type = NULL, year = NULL, days = 30, fill.col = "turquoise4", int.method = "lineal", axisname = expression(paste("Pollen grains / m"^"3")), ...)
data |
A |
pollen.type |
A |
year |
A |
days |
A |
fill.col |
A |
int.method |
A |
axisname |
A |
... |
Other arguments passed on to the pollen season calculation as specified in |
plot_ps
function is designed to easily plot the main pollen season (Galan et al., 2017). The pre_peak period and the post_peak period are marked with different color intensity in the graph. The user must choose a single pollen type and season to plot.
The function returns an object of class ggplot
with a graphical representation of the main pollen season of the selected pollen type. The pre_peak and post_peak periods are marked with different color intensity.
Galan, C., Ariatti, A., Bonini, M., Clot, B., Crouzy, B., Dahl, A., Fernandez_Gonzalez, D., Frenguelli, G., Gehrig, R., Isard, S., Levetin, E., Li, D.W., Mandrioli, P., Rogers, C.A., Thibaudon, M., Sauliene, I., Skjoth, C., Smith, M., Sofiev, M., 2017. Recommended terminology for aerobiological studies. Aerobiologia (Bologna). 293_295.
calculate_ps
, interpollen
, ggplot
.
data("munich_pollen") plot_ps(munich_pollen, year = 2013, pollen.type = "Betula")
data("munich_pollen") plot_ps(munich_pollen, year = 2013, pollen.type = "Betula")
Function to plot the pollen data during several seasons. Also plots the averaged pollen season over the study period. It is possible to plot the relative abundance per day and smoothing the pollen season by calculating a moving average.
plot_summary(data, pollen, mave = 1, normalized = FALSE, interpolation = TRUE, int.method = "lineal", export.plot = FALSE, export.format = "pdf", axisname = "Pollen grains / m3", ...)
plot_summary(data, pollen, mave = 1, normalized = FALSE, interpolation = TRUE, int.method = "lineal", export.plot = FALSE, export.format = "pdf", axisname = "Pollen grains / m3", ...)
data |
A |
pollen |
A |
mave |
An |
normalized |
A |
interpolation |
A |
int.method |
A |
export.plot |
A |
export.format |
A |
axisname |
A |
... |
Other additional arguments may be used to customize the exportation of the plots using |
This function allows to summarize the pollen season by a simple plot. Even though the package was originally designed to treat aeropalynological data, it can be used to study many other atmospheric components (e.g., bacteria in the air, fungi, insects ...) (Buters et al., 2018; Oteros et al., 2019).
This function returns plot of class ggplot2. User are able to customize the output as a ggplot2 object.
Buters, J. T. M., Antunes, C., Galveias, A., Bergmann, K. C., Thibaudon, M., Galan, C. & Oteros, J. (2018). Pollen and spore monitoring in the world. Clinical and translational allergy, 8(1), 9.
Oteros, J., Bartusel, E., Alessandrini, F., Nunez, A., Moreno, D. A., Behrendt, H., ... & Buters, J. (2019). Artemisia pollen is the main vector for airborne endotoxin. Journal of Allergy and Clinical Immunology.
calculate_ps
; plot_normsummary
data("munich_pollen") plot_summary(munich_pollen, pollen = "Betula", export.plot = FALSE, interpolation = FALSE)
data("munich_pollen") plot_summary(munich_pollen, pollen = "Betula", export.plot = FALSE, interpolation = FALSE)
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", ...)
plot_trend(data, interpolation = TRUE, int.method = "lineal", export.plot = TRUE, export.format = "pdf", export.result = TRUE, method = "percentage", ...)
data |
A |
interpolation |
A |
int.method |
A |
export.plot |
A |
export.format |
A |
export.result |
A |
method |
A |
... |
Additional arguments for the function |
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.
data("munich_pollen") plot_trend(munich_pollen, interpolation = FALSE, export.plot = FALSE, export.result = TRUE)
data("munich_pollen") plot_trend(munich_pollen, interpolation = FALSE, export.plot = FALSE, export.result = TRUE)
Function to calculate the pollen calendar from a historical database of several pollen types and using the most commonly used methods in the generation of the pollen calendars in the aerobiology field.
pollen_calendar(data, method = "heatplot", n.types = 15, start.month = 1, y.start = NULL, y.end = NULL, perc1 = 80, perc2 = 99, th.pollen = 1, average.method = "avg_before", period = "daily", method.classes = "exponential", n.classes = 5, classes = c(25, 50, 100, 300), color = "green", interpolation = TRUE, int.method = "lineal", na.remove = TRUE, result = "plot", export.plot = FALSE, export.format = "pdf", legendname = "Pollen grains / m3", ...)
pollen_calendar(data, method = "heatplot", n.types = 15, start.month = 1, y.start = NULL, y.end = NULL, perc1 = 80, perc2 = 99, th.pollen = 1, average.method = "avg_before", period = "daily", method.classes = "exponential", n.classes = 5, classes = c(25, 50, 100, 300), color = "green", interpolation = TRUE, int.method = "lineal", na.remove = TRUE, result = "plot", export.plot = FALSE, export.format = "pdf", legendname = "Pollen grains / m3", ...)
data |
A |
method |
A |
n.types |
A |
start.month |
A |
y.start , y.end
|
A |
perc1 , perc2
|
A |
th.pollen |
A |
average.method |
A |
period |
A |
method.classes |
A |
n.classes |
A |
classes |
A |
color |
A |
interpolation |
A |
int.method |
A |
na.remove |
A |
result |
A |
export.plot |
A |
export.format |
A |
legendname |
A |
... |
Other additional arguments may be used to customize the exportation of the plots using |
This function allows to calculate and generate the pollen calendar using three different methods which are described below. The pollen calendar will be calculated and generated only for the period specified by the user using the y.start
and y.end
arguments, and for the specified number of the most abundant pollen types using the n.types
argument by the user. The most abundant pollen types will be selected according to the highest average annual amounts of pollen registered by the pollen types during the considered period.
"heatplot"
method. This pollen calendar is constructed based on the daily or weekly average of pollen concentrations, depending of the preferences of the user that may select "daily"
or "weekly"
as period
argument. Then, these averages may be classified in different categories following different methods selected by the user according to the method.classes
argument. If method.classes = "exponential"
the user will apply the classification based on exponential classes proposed by Stix and Ferreti (1974), which has been commonly used in aerobiology for the generation of pollen calendars. The classification based on exponential method considers 11 classes (1_2, 3_5, 6_11, 12_24, 25_49, 50_99, 100_199, 200_399, 400_799, 800_1600, >1600
). An example of this pollen calendar may be consulted in Rojo et al. (2016). This method to design pollen calendars is an adaptation from the pollen calendar proposed by Spieksma (1991) who considered 10_day periods instead of daily or weekly periods. Otherwise, if method.classes = "custom"
the user may customize the classification according to the number of classes selected (n.classes
argument) and the thresholds of the pollen concentrations used to define the classes (classes
argument). Average values below the level of the th.pollen
argument will be removed from the pollen calendar.
"phenological"
method. This pollen calendar is based on phenological definition of the pollen season and adapted from the methodology proposed by Werchan et al. (2018). After to obtain daily average pollen concentrations for the most abundant pollen types different pollination periods were calculated using the daily averages. The main pollination period was calculated based on the percentage defined by perc1
argument (selected by the user, 80% by default) of the annual total pollen. For example, if perc1 = 80
the beginning of the high season was marked when 10% of the annual value was reached and the end was selected when 90% was reached. In the case of the early/late pollination a total of the percentage defined by perc2
argument (selected by the user, 99% by default) of the annual total pollen will be registered during this period. For this kind of pollen calendar the th.pollen
argument will define the "possible occurrence" period as adapted by Werchan et al. (2018), considering the entire period between the first and the last day when this pollen level is reached. In an alternative way the average may be carried out after to define the pollen seasons using method_average = "avg_after"
(instead of "avg_before"
by default). "avg_after"
determines the pollen season for all years and all pollen types, and then an average for circular data is calculated from the start_dates and end_dates.
"violinplot"
method. This pollen calendar is based on the pollen intensity and adapted from the pollen calendar published by ORourke (1990). In first time the daily averages of the pollen concentrations are calculated and then these averages are represented using the violin plot graph. The shape of the violin plot display the pollen intensity of the pollen types in a relative way i.e. the values will be calculated as relative measurements regarding to the most abundant pollen type in annual amounts. Therefore, this pollen calendar shows a relative comparison between the pollen intensity of the pollen types but without scales and units. Average values below the level of the th.pollen
argument will be removed from the pollen calendar.
Pollen time series frequently have different gaps with no data and this fact could be a problem for the calculation of specific methods for defining the pollen season even providing incorrect results. In this sense by default a linear interpolation will be carried out to complete these gaps before to generate the pollen calendar. For more information to see the interpollen
function.
This function returns different results:plot
in the active graphics window displaying the pollen calendar generated by the user when result = "plot"
. This plot may be included in an object by assignment operators.data.frame
including the daily or weekly average pollen concentrations (according to the selection of the user) used to generate the pollen calendar. This data.frame
will be returned when result = "table"
.
If export.plot = TRUE
this plot displaying the pollen calendar will also be exported as file within the Plot_AeRobiology" directory created in the working directory.
If export.plot = TRUE
and export.format = pdf
a pdf file of the pollen calendar will be saved within the plot_AeRobiology directory created in the working directory. Additional characteristics may be incorporated to the exportation as pdf file (see grDevices package)
If export.plot = TRUE
and export.format = png
a png file of the pollen calendar will be saved within the plot_AeRobiology directory created in the working directory. Additional characteristics may be incorporated to the exportation as png file (see grDevices package).
ORourke, M.K., 1990. Comparative pollen calendars from Tucson, Arizona: Durhamvs. Burkard samplers. Aerobiologia, 6(2), p.136_140.
Rojo, J., Rapp, A., Lara, B., Sabariego, S., Fernandez_Gonzalez, F. and Perez_Badia, R., 2016. Characterisation of the airborne pollen spectrum in Guadalajara (central Spain) and estimation of the potential allergy risk. Environmental Monitoring and Assessment, 188(3), p.130.
Spieksma, F.T.M., 1991. Regional European pollen calendars. Allergenic pollen and pollinosis in Europe, pp.49_65.
Stix, E. and Ferretti, M.L., 1974. Pollen calendars of three locations in Western Germany. Atlas European des Pollens Allergisants, pp.85_94.
Werchan, M., Werchan, B. and Bergmann, K.C., 2018. German pollen calendar 4.0_update based on 2011_2016 pollen data. Allergo Journal International, 27, pp.69_71.
data("munich_pollen") pollen_calendar(munich_pollen, method = "heatplot", interplation = FALSE)
data("munich_pollen") pollen_calendar(munich_pollen, method = "heatplot", interplation = FALSE)
A dataset containing information of 3-hourly concentrations of pollen in the atmosphere of Munich (DEBIED) and Viechtach (DEVIEC) during the year 2018. Pollen types included: "Poaceae" and "Pinus".
POMO_pollen
POMO_pollen
Time series of 3-hours pollen concentrations expressed as pollen grains / m3 of air.
Data were obtained by the automatic pollen monitor BAA500 from Munich and Viechtach in Bavaria (Germany) data("POMO_pollen")
, supplied by the public ePIN Network supported by the Bavarian Government. The ePIN Network was built by Das Bayerische Landesamt für Gesundheit und Lebensmittelsicherheit (LGL) in collaboration with Zentrum Allergie und Umwelt (ZAUM).
Oteros, J., et al., ... & Buters, J. T. (2019). Building an automatic Pollen Monitoring Network (ePIN): Selection of optimal sites by clustering pollen stations.
Oteros, J., Pusch, G., Weichenmeier, I., Heimann, U., Mueller, R., Roeseler, S., ... & Buters, J. T. (2015). Automatic and online pollen monitoring.
Hirst, J.M., 1952. AN AUTOMATIC VOLUMETRIC SPORE TRAP. Ann. Appl. Biol. 39, 257_265.
VDI 4252_4. (2016). Bioaerosole und biologische Agenzien_Ermittlung von Pollen und Sporen in der Aussenluft unterVerwendung einer volumetrischen Methode fuer einMessnetz zu allergologischen Zwecken. VDI_Richtlinie4252 Blatt 4, Entwurf. VDI/DIN_Handbuch Reinhaltungder Luft, Band 1a: Beuth, Berlin
Function to check the quality of an historical database of several pollen types.
quality_control(data, int.window = 2, perc.miss = 20, ps.method = "percentage", result = "plot", th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", int.method = "lineal", ...)
quality_control(data, int.window = 2, perc.miss = 20, ps.method = "percentage", result = "plot", th.day = 100, perc = 95, def.season = "natural", reduction = FALSE, red.level = 0.9, derivative = 5, man = 11, th.ma = 5, n.clinical = 5, window.clinical = 7, window.grains = 5, th.pollen = 10, th.sum = 100, type = "none", int.method = "lineal", ...)
data |
A |
int.window |
A |
perc.miss |
A |
ps.method |
A |
result |
A |
th.day |
See |
perc |
See |
def.season |
See |
reduction |
See |
red.level |
See |
derivative |
See |
man |
See |
th.ma |
See |
n.clinical |
See |
window.clinical |
See |
window.grains |
See |
th.pollen |
See |
th.sum |
See |
type |
See |
int.method |
See |
... |
Other arguments passed on to the pollen season calculation as specified in |
Quality control is a relevant topic for aerobiology (Oteros et al., 2013). This function is another approach to improve the quality control management in the field. quality_control
function checks the quality of the pollen data of each pollen type and season. The filters applied by the function are:
If the main pollen season (Galan et al., 2017) cannot be calculated according to calculate_ps
function minimal requirements (lack of data for these pollen type and year). Filter named "Complete"
in the "quality_control"
data.frame
.
If the start, end or peak date of the main pollen season has been interpolated or a day near to it (number of days specified by int.window
argument). If a day near to these dates is missing, the selected date could not be the right one. Filters named "Start"
, "Peak"
and "End"
in the "quality_control"
data.frame
.
The percentage of missing data inside the main pollen season. It calculates the number of days which have been interpolated by the algorithm and their percentage inside the main pollen season. If a high percentage of the main pollen season has been interpolated, the information of these season could not be reliable. Filter named "Comp.MPS"
in the "quality_control"
data.frame
.
This function can return different results:
If result = "plot"
: Graphical resume of the Quality Control results showing the seasons of each pollen type and their quality (the risk assumed if they are included in further studies). The legend indicates the number of filter that have been unsuccessfully passed for each case. Object of class ggplot
. For graphical customization, see ggplot
function.
If result = "table"
: data.frame
with logical
values for each pollen type and season. If TRUE
, the filter has been successfully passed for this case. If FALSE, this case does not fit the minimal requirements of this filter.
Galan, C., Ariatti, A., Bonini, M., Clot, B., Crouzy, B., Dahl, A., Fernandez_Gonzalez, D., Frenguelli, G., Gehrig, R., Isard, S., Levetin, E., Li, D.W., Mandrioli, P., Rogers, C.A., Thibaudon, M., Sauliene, I., Skjoth, C., Smith, M., Sofiev, M., 2017. Recommended terminology for aerobiological studies. Aerobiologia (Bologna). 293_295.
Oteros, J., Galan, C., Alcazar, P., & Dominguez_Vilches, E. (2013). Quality control in bio_monitoring networks, Spanish Aerobiology Network. Science of the Total Environment, 443, 559_565.
calculate_ps
, interpollen
, ggplot
, ggsave
data("munich_pollen") quality_control(munich_pollen[,c(1:4)])
data("munich_pollen") quality_control(munich_pollen[,c(1:4)])