Learn R Programming

AeRobiology (version 1.0.3)

qualitycontrol: Quality Control of a Pollen Database

Description

Function to check the quality of an historical database of several pollen types.

Usage

qualitycontrol(data, int.window = 2, perc.miss = 20,
  ps.method = "percentage", export.result = TRUE,
  export.format = "pdf", 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",
  export.width = 10, export.height = 10, ...)

Arguments

data

A data.frame object including the general database where quality must be checked. This data.frame must include a first column in Date format and the rest of columns in numeric format belonging to each pollen type by column. It is not necessary to insert the missing gaps; the function will automatically detect them.

int.window

A numeric (interger)value bigger or equal to 1. The argument specifies the number of days of each side of the start, peak or end date of the main pollen season which will be checked during the quality control. If any of these days has been interpolated, the current season will not pass the quality control. The int.window argument will be 2 by default.

perc.miss

A numeric (interger) value between 0 and 100. The argument specifies the maximal percentage of interpolated days which is allowed inside the main pollen season to pass the quality control. The perc.miss argument will be 20 by default.

ps.method

A character string specifying the method applied to calculate the pollen season and the main parameters. The implemented methods that can be used are: "percentage", "logistic", "moving", "clinical" or "grains". A more detailed information about the different methods for defining the pollen season may be consulted in calculate_ps function. The ps.method argument will be "percentage" by default.

export.result

A logical argument. If TRUE, graphical resume of the quality control and pollen season parameters will be exported in your working directory and a new folder ("table_AeRobiology") will be created with a xlsx file inside including all parameters calculated from the definition of the pollen season. A more detailed information may be consulted in Details and calculate_ps function. The export.result argument will be TRUE by default.

export.format

A character string specifying the file extension of the quality control graphical resume when its saved. Only valid if export.result = TRUE. The implemented options that can be used are: "pdf", "png", "jpeg", "tiff" or "bmp". The argument will be "pdf" by default.

th.day

See calculate_ps for more details.

perc

See calculate_ps for more details.

def.season

See calculate_ps for more details.

reduction

See calculate_ps for more details.

red.level

See calculate_ps for more details.

derivative

See calculate_ps for more details.

man

See calculate_ps for more details.

th.ma

See calculate_ps for more details.

n.clinical

See calculate_ps for more details.

window.clinical

See calculate_ps for more details.

window.grains

See calculate_ps for more details.

th.pollen

See calculate_ps for more details.

th.sum

See calculate_ps for more details.

type

See calculate_ps for more details.

int.method

See calculate_ps for more details.

export.width

A numeric (double) value specifying the width of the graph in inches. Only valid if export.result = TRUE. See ggsave function for more details. The export.wodth = TRUE argument will be 10 by default.

export.height

A numeric (double) value specifying the height of the graph in inches. Only valid if export.result = TRUE. See ggsave function for more details. The export.height argument will be 10 by default.

...

Other arguments passed on to the pollen season calculation as specified in calculate_ps function.

Value

This function returns different results:

  • 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.

  • data.frame named "QualityControl" with logical values indicating 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.

  • If export.result = TRUE, the graphical resume and a data.frame will be exported. The graphical resume will be exported with the file extension specified with export.format argument The data.frame will be exported as xlsx file within the "table_AeRobiology" folder 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)

Details

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. qualitycontrol 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 "QualityControl" 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 "QualityControl" 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 "QualityControl" data.frame.

References

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.

See Also

calculate_ps, interpollen, ggplot, ggsave

Examples

Run this code
# NOT RUN {
data("munich")
qualitycontrol(munich[,c(1:4)], export.result = FALSE)
# }

Run the code above in your browser using DataLab