From 123cb24e32a288d2c085289788f3156537439b0e Mon Sep 17 00:00:00 2001 From: jack-davison <45171616+jack-davison@users.noreply.github.com> Date: Tue, 22 Oct 2024 07:05:19 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20davidcar?= =?UTF-8?q?slaw/openair@dbe9e89fd1bd3350032e14e1e28f718bd2901caf=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/index.html | 15 ++++++++++++--- pkgdown.yml | 2 +- reference/importUKAQ.html | 8 +++++--- reference/timePlot.html | 2 +- search.json | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/news/index.html b/news/index.html index c9818e0d..d5c943a0 100644 --- a/news/index.html +++ b/news/index.html @@ -37,7 +37,15 @@
add calm.thresh
as an option to windRose
. This change allows users to set a non-zero wind speed threshold that is considered as calm.
The source
argument of importUKAQ()
now defaults to NULL
. This option allows the function to assign the source
of each site
itself, with some caveats:
Ambiguous codes (e.g., "AD1"
, which corresponds to a SAQN and locally managed site) will preferentially import from the national networks (AURN, then AQE/SAQN/WAQN/NIAQN) over locally-managed networks. To override this users should manually define source
.
Incorrect codes not found in importMeta()
will error if importUKAQ()
is left to assign the source
.
When data_type
is one of the aggregate types (e.g., "annual"
) and a site
isn’t defined, a source
must be provided.
It is likely slightly slower for the function to assign source
itself than for users to specify it themselves.
The formula.label
argument of polarPlot()
will now control whether concentration information is printed when statistic = "cpf"
.
add calm.thresh
as an option to windRose
. This change allows users to set a non-zero wind speed threshold that is considered as calm.
Added new features for openColours()
:
Added new qualitative colour palettes: the “tol” family are colour-blind friendly palettes based on the work of Paul Tol (https://personal.sron.nl/~pault/), and “tableau” and “observable” provide access to the “Tableau10” and “Observable10” palettes to aid in consistency with plots made in those platforms.
importUKAQ()
would drop sites if importing from local
sites and another network.Fixed an issue wherein importUKAQ()
would drop sites if importing from local
sites and another network.
polarCluster()
will no longer error with multiple pollutant
s and a single n.clusters
.
CRAN release: 2024-03-11
corPlot
to carry through “use” option in cor
.corPlot()
to carry through “use” option in cor
.importUKAQ(
site = "my1",
year = 2022,
- source = "aurn",
+ source = NULL,
data_type = "hourly",
pollutant = "all",
hc = FALSE,
@@ -92,8 +92,10 @@ Argumentssource
-The network to which the site
(s) belong, defaulting to
-"aurn"
. Providing a single network will attempt to import all of the
+
The network to which the site
(s) belong. The default, NULL
,
+allows importUKAQ()
to guess the correct source
, preferring national
+networks over locally managed networks. Alternatively, users can define a source
.
+Providing a single network will attempt to import all of the
given site
s from the provided network. Alternatively, a vector of sources
can be provided of the same length as site
to indicate which network each
site
individually belongs. Available networks include:
"aurn"
, The UK Automatic Urban and Rural Network.
diff --git a/reference/timePlot.html b/reference/timePlot.html
index 0766de23..d038f4da 100644
--- a/reference/timePlot.html
+++ b/reference/timePlot.html
@@ -379,7 +379,7 @@ Examples scale
#> function (x, center = TRUE, scale = TRUE)
#> UseMethod("scale")
-#> <bytecode: 0x55e219b153c0>
+#> <bytecode: 0x55e65fa6d680>
#> <environment: namespace:base>
if (FALSE) { # \dontrun{
timePlot(mydata, pollutant = c("nox", "co", "pm10", "so2"), group = TRUE, avg.time =
diff --git a/search.json b/search.json
index 7e760aae..71797ed9 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behaviour contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behaviour include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible via GitHub platform. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behaviour deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behaviour inappropriate. public apology may requested.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behaviour. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behaviour. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to openairmaps","title":"Contributing to openairmaps","text":"outlines propose change openairmaps.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to openairmaps","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to openairmaps","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to openairmaps","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"davidcarslaw/openair\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header).","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to openairmaps","text":"Care taken new code follows style similar rest openair. user-facing example exported functions written “lowerCamelCase” (.e., polarPlot() rather polar_plot()). use roxygen2, Markdown syntax, documentation.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to openairmaps","text":"Please note openair project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 2, June 1991Copyright © 1989, 1991 Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"licenses software designed take away freedom share change . contrast, GNU General Public License intended guarantee freedom share change free software–make sure software free users. General Public License applies Free Software Foundation’s software program whose authors commit using . (Free Software Foundation software covered GNU Lesser General Public License instead.) can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge service wish), receive source code can get want , can change software use pieces new free programs; know can things. protect rights, need make restrictions forbid anyone deny rights ask surrender rights. restrictions translate certain responsibilities distribute copies software, modify . example, distribute copies program, whether gratis fee, must give recipients rights . must make sure , , receive can get source code. must show terms know rights. protect rights two steps: (1) copyright software, (2) offer license gives legal permission copy, distribute /modify software. Also, author’s protection , want make certain everyone understands warranty free software. software modified someone else passed , want recipients know original, problems introduced others reflect original authors’ reputations. Finally, free program threatened constantly software patents. wish avoid danger redistributors free program individually obtain patent licenses, effect making program proprietary. prevent , made clear patent must licensed everyone’s free use licensed . precise terms conditions copying, distribution modification follow.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"terms-and-conditions-for-copying-distribution-and-modification","dir":"","previous_headings":"","what":"TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION","title":"GNU General Public License","text":"0. License applies program work contains notice placed copyright holder saying may distributed terms General Public License. “Program”, , refers program work, “work based Program” means either Program derivative work copyright law: say, work containing Program portion , either verbatim modifications /translated another language. (Hereinafter, translation included without limitation term “modification”.) licensee addressed “”. Activities copying, distribution modification covered License; outside scope. act running Program restricted, output Program covered contents constitute work based Program (independent made running Program). Whether true depends Program . 1. may copy distribute verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice disclaimer warranty; keep intact notices refer License absence warranty; give recipients Program copy License along Program. may charge fee physical act transferring copy, may option offer warranty protection exchange fee. 2. may modify copy copies Program portion , thus forming work based Program, copy distribute modifications work terms Section 1 , provided also meet conditions: ) must cause modified files carry prominent notices stating changed files date change. b) must cause work distribute publish, whole part contains derived Program part thereof, licensed whole charge third parties terms License. c) modified program normally reads commands interactively run, must cause , started running interactive use ordinary way, print display announcement including appropriate copyright notice notice warranty (else, saying provide warranty) users may redistribute program conditions, telling user view copy License. (Exception: Program interactive normally print announcement, work based Program required print announcement.) requirements apply modified work whole. identifiable sections work derived Program, can reasonably considered independent separate works , License, terms, apply sections distribute separate works. distribute sections part whole work based Program, distribution whole must terms License, whose permissions licensees extend entire whole, thus every part regardless wrote . Thus, intent section claim rights contest rights work written entirely ; rather, intent exercise right control distribution derivative collective works based Program. addition, mere aggregation another work based Program Program (work based Program) volume storage distribution medium bring work scope License. 3. may copy distribute Program (work based , Section 2) object code executable form terms Sections 1 2 provided also one following: ) Accompany complete corresponding machine-readable source code, must distributed terms Sections 1 2 medium customarily used software interchange; , b) Accompany written offer, valid least three years, give third party, charge cost physically performing source distribution, complete machine-readable copy corresponding source code, distributed terms Sections 1 2 medium customarily used software interchange; , c) Accompany information received offer distribute corresponding source code. (alternative allowed noncommercial distribution received program object code executable form offer, accord Subsection b .) source code work means preferred form work making modifications . executable work, complete source code means source code modules contains, plus associated interface definition files, plus scripts used control compilation installation executable. However, special exception, source code distributed need include anything normally distributed (either source binary form) major components (compiler, kernel, ) operating system executable runs, unless component accompanies executable. distribution executable object code made offering access copy designated place, offering equivalent access copy source code place counts distribution source code, even though third parties compelled copy source along object code. 4. may copy, modify, sublicense, distribute Program except expressly provided License. attempt otherwise copy, modify, sublicense distribute Program void, automatically terminate rights License. However, parties received copies, rights, License licenses terminated long parties remain full compliance. 5. required accept License, since signed . However, nothing else grants permission modify distribute Program derivative works. actions prohibited law accept License. Therefore, modifying distributing Program (work based Program), indicate acceptance License , terms conditions copying, distributing modifying Program works based . 6. time redistribute Program (work based Program), recipient automatically receives license original licensor copy, distribute modify Program subject terms conditions. may impose restrictions recipients’ exercise rights granted herein. responsible enforcing compliance third parties License. 7. , consequence court judgment allegation patent infringement reason (limited patent issues), conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. distribute satisfy simultaneously obligations License pertinent obligations, consequence may distribute Program . example, patent license permit royalty-free redistribution Program receive copies directly indirectly , way satisfy License refrain entirely distribution Program. portion section held invalid unenforceable particular circumstance, balance section intended apply section whole intended apply circumstances. purpose section induce infringe patents property right claims contest validity claims; section sole purpose protecting integrity free software distribution system, implemented public license practices. Many people made generous contributions wide range software distributed system reliance consistent application system; author/donor decide willing distribute software system licensee impose choice. section intended make thoroughly clear believed consequence rest License. 8. distribution /use Program restricted certain countries either patents copyrighted interfaces, original copyright holder places Program License may add explicit geographical distribution limitation excluding countries, distribution permitted among countries thus excluded. case, License incorporates limitation written body License. 9. Free Software Foundation may publish revised /new versions General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies version number License applies “later version”, option following terms conditions either version later version published Free Software Foundation. Program specify version number License, may choose version ever published Free Software Foundation. 10. wish incorporate parts Program free programs whose distribution conditions different, write author ask permission. software copyrighted Free Software Foundation, write Free Software Foundation; sometimes make exceptions . decision guided two goals preserving free status derivatives free software promoting sharing reuse software generally.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"no-warranty","dir":"","previous_headings":"","what":"NO WARRANTY","title":"GNU General Public License","text":"11. PROGRAM LICENSED FREE CHARGE, WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION. 12. EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MAY MODIFY /REDISTRIBUTE PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES. END TERMS CONDITIONS","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively convey exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program interactive, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, commands use may called something show w show c; even mouse-clicks menu items–whatever suits program. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. sample; alter names: General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License.","code":" Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice"},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"import-data-from-the-uk-automatic-urban-and-rural-network","dir":"Articles","previous_headings":"","what":"Import data from the UK Automatic Urban and Rural Network","title":"Examples of {openair} Functionality","text":"easy import hourly data 100s sites import several sites one time several years data.","code":"kc1 <- importAURN(site = \"kc1\", year = 2020) kc1 #> # A tibble: 8,784 × 15 #> source site code date co nox no2 no o3 so2 #> #> 1 aurn London … KC1 2020-01-01 00:00:00 0.214 64.8 46.2 12.1 1.13 NA #> 2 aurn London … KC1 2020-01-01 01:00:00 0.237 74.1 45.0 19.0 1.20 NA #> 3 aurn London … KC1 2020-01-01 02:00:00 0.204 60.5 41.4 12.4 1.50 NA #> 4 aurn London … KC1 2020-01-01 03:00:00 0.204 53.5 39.8 8.93 1.60 NA #> 5 aurn London … KC1 2020-01-01 04:00:00 0.169 37.7 33.6 2.63 5.79 NA #> 6 aurn London … KC1 2020-01-01 05:00:00 0.160 43.3 36.8 4.25 6.09 NA #> 7 aurn London … KC1 2020-01-01 06:00:00 0.157 48.2 39.4 5.76 2.74 NA #> 8 aurn London … KC1 2020-01-01 07:00:00 0.178 60.5 44.7 10.3 1.20 NA #> 9 aurn London … KC1 2020-01-01 08:00:00 0.233 71.8 47.9 15.6 2.25 NA #> 10 aurn London … KC1 2020-01-01 09:00:00 0.329 128. 46.9 53.2 2.25 NA #> # ℹ 8,774 more rows #> # ℹ 5 more variables: pm10 , pm2.5 , ws , wd , #> # air_temp "},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"utility-functions","dir":"Articles","previous_headings":"","what":"Utility functions","title":"Examples of {openair} Functionality","text":"Using selectByDate() function easy select quite complex time-based periods. example, select weekday (Monday Friday) data June September 2012 hours 7am 7pm inclusive: Similarly easy time-average data many flexible ways. example, 2-week means can calculated ","code":"sub <- selectByDate( kc1, day = \"weekday\", year = 2020, month = 6:9, hour = 7:19 ) sub #> # A tibble: 1,144 × 15 #> date source site code co nox no2 no o3 so2 #> #> 1 2020-06-01 07:00:00 aurn London… KC1 0.125 23.1 16.8 4.14 56.5 2.29 #> 2 2020-06-01 08:00:00 aurn London… KC1 0.133 25.2 17.8 4.79 61.7 2.68 #> 3 2020-06-01 09:00:00 aurn London… KC1 0.119 15.6 12.2 2.22 75.8 2.35 #> 4 2020-06-01 10:00:00 aurn London… KC1 0.104 13.8 11.1 1.79 87.1 1.57 #> 5 2020-06-01 11:00:00 aurn London… KC1 0.0956 14.0 11.8 1.46 96.7 1.44 #> 6 2020-06-01 12:00:00 aurn London… KC1 0.0985 11.3 9.97 0.893 106. 1.44 #> 7 2020-06-01 13:00:00 aurn London… KC1 0.0927 11.0 9.64 0.893 112. 2.03 #> 8 2020-06-01 14:00:00 aurn London… KC1 0.0927 12.5 10.8 1.14 114. 2.81 #> 9 2020-06-01 15:00:00 aurn London… KC1 0.0811 10.7 9.48 0.822 115. 2.88 #> 10 2020-06-01 16:00:00 aurn London… KC1 0.0898 13.9 11.9 1.29 104. 2.22 #> # ℹ 1,134 more rows #> # ℹ 5 more variables: pm10 , pm2.5 , ws , wd , #> # air_temp sub2 <- timeAverage(kc1, avg.time = \"2 week\") sub2 #> # A tibble: 27 × 12 #> date co nox no2 no o3 so2 pm10 pm2.5 ws #> #> 1 2019-12-30 00:00:00 0.135 26.2 22.7 2.34 46.4 1.94 12.5 8.43 3.94 #> 2 2020-01-13 00:00:00 0.205 74.4 37.3 24.2 30.4 2.68 18.5 13.1 3.11 #> 3 2020-01-27 00:00:00 0.143 39.4 26.7 8.24 47.8 2.72 13.9 8.45 4.51 #> 4 2020-02-10 00:00:00 0.118 19.2 16.4 1.85 63.0 3.09 9.40 5.03 6.18 #> 5 2020-02-24 00:00:00 0.144 31.4 24.5 4.50 53.5 2.61 10.4 5.99 4.54 #> 6 2020-03-09 00:00:00 0.116 19.7 17.0 1.73 60.0 2.09 10.0 5.73 4.61 #> 7 2020-03-23 00:00:00 0.132 23.2 19.8 2.26 69.1 1.90 18.9 12.3 3.61 #> 8 2020-04-06 00:00:00 0.112 27.1 24.1 1.99 72.4 2.02 26.1 18.2 2.96 #> 9 2020-04-20 00:00:00 0.103 15.8 14.1 1.13 76.7 2.09 16.8 9.60 3.45 #> 10 2020-05-04 00:00:00 0.112 17.8 15.7 1.35 76.0 1.85 13.7 8.32 3.29 #> # ℹ 17 more rows #> # ℹ 2 more variables: wd , air_temp "},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"the-type-option","dir":"Articles","previous_headings":"","what":"The type option","title":"Examples of {openair} Functionality","text":"One key aspects openair use type option, available almost openair functions. type option partitions data different categories variable. many built-options type can take based splitting data different date values. summary -built values type : \"year\" splits data year \"month\" splits variables month year \"monthyear\" splits data year month \"season\" splits variables season. Note case user can also supply hemisphere option can either \"northern\" (default) \"southern\" \"weekday\" splits variables day week \"weekend\" splits variables Saturday, Sunday, weekday \"daylight\" splits variables nighttime/daytime. Note user must supply longitude latitude \"dst\" splits variables daylight saving time non-daylight saving time \"wd\" wind direction (wd) available. type = \"wd\" split data 8 sectors: N, NE, E, SE, S, SW, W, NW. \"seasonyear\" (\"yearseason\") split data year-season intervals, keeping months season together. example, December 2010 considered part winter 2011 (January February 2011). makes easier consider contiguous seasons. contrast, type = \"season\" just split data four seasons regardless year. type can also use variables already data frame: categorical variable specified, e.g., site variables can used directly e.g. type = \"site\". numeric numeric variable specified split 4 quantiles, .e., four partitions containing equal numbers points. Note user can supply option n.levels indicate many quantiles use.","code":""},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"example-directional-analysis","dir":"Articles","previous_headings":"","what":"Example directional analysis","title":"Examples of {openair} Functionality","text":"openair can plot basic wind roses easily provided variables ws (wind speed) wd (wind direction) available. However, real flexibility comes able use type option. Wind roses summarising wind conditions monitoring station per year, demonstrating openair type option. many flavours bivariate polar plots, described useful understanding air pollution sources.","code":"windRose(mydata) windRose(mydata, type = \"year\", layout = c(4, 2) ) polarPlot(mydata, pollutant = \"so2\", statistic = \"cpf\", percentile = 90, cols = \"YlGnBu\" )"},{"path":"https://davidcarslaw.github.io/openair/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"David Carslaw. Author, maintainer. Jack Davison. Author. Karl Ropkins. Author.","code":""},{"path":"https://davidcarslaw.github.io/openair/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Carslaw, D. C. K. Ropkins, (2012) openair --- R package air quality data analysis. Environmental Modelling & Software. Volume 27-28, 52-61.","code":"@Article{, title = {openair --- An R package for air quality data analysis}, author = {David C. Carslaw and Karl Ropkins}, journal = {Environmental Modelling & Software}, volume = {27--28}, number = {0}, pages = {52--61}, year = {2012}, issn = {1364-8152}, doi = {10.1016/j.envsoft.2011.09.008}, }"},{"path":[]},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_-core-features","dir":"","previous_headings":"","what":"💡 Core Features","title":"Tools for the Analysis of Air Pollution Data","text":"openair developed many years form extensive toolkit functions analysing air quality atmospheric composition data. Access data several hundred UK air pollution monitoring sites importUKAQ() family functions. Time Series & Trend analysis explore air quality concentrations vary time (e.g., timePlot(), timeVariation(), calendarPlot()). Directional analysis help characterise different sources pollution, including creation bivariate polar plots using polarPlot(). Trajectory analysis examine NOAA Hysplit trajectories, plotting (trajPlot()), heatmap (trajLevel()) clustering (trajCluster()) functionality. Utility functions, timeAverage() selectByDate() make easier manipulate atmospheric composition data. Flexible plot conditioning easily plot data hour day, day week, season year, etc., type option available functions.","code":""},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_-documentation","dir":"","previous_headings":"","what":"📖 Documentation","title":"Tools for the Analysis of Air Pollution Data","text":"openair functions fully documented; access documentation using R IDE choice. Documentation also hosted online package website. guide openair toolkit can found online book, contains lots code snippets, demonstrations functionality, ideas application openair’s various functions.","code":"?openair::polarPlot"},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_️-installation","dir":"","previous_headings":"","what":"🗃️ Installation","title":"Tools for the Analysis of Air Pollution Data","text":"openair can installed CRAN : can also install development version openair GitHub using pak: 🏛️ openair primarily maintained David Carslaw. 📃 openair licensed GNU General Public License. 🧑💻 Contributions welcome wider community. See contributing guide code conduct information.","code":"install.packages(\"openair\") # install.packages(\"pak\") pak::pak(\"davidcarslaw/openair\")"},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":null,"dir":"Reference","previous_headings":"","what":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Function draw Taylor Diagrams model evaluation. function allows conditioning categorical numeric variables, makes function flexible.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"","code":"TaylorDiagram( mydata, obs = \"obs\", mod = \"mod\", group = NULL, type = \"default\", normalise = FALSE, cols = \"brewer1\", rms.col = \"darkgoldenrod\", cor.col = \"black\", arrow.lwd = 3, annotate = \"centred\\nRMS error\", text.obs = \"observed\", key = TRUE, key.title = group, key.columns = 1, key.pos = \"right\", strip = TRUE, auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"mydata data frame minimally containing column observations column predictions. obs column observations predictions (mod) compared. mod column model predictions. Note, mod can length 2 .e. two lots model predictions. two sets predictions present e.g. mod = c(\"base\", \"revised\"), arrows shown Taylor Diagram show change model performance going first second. useful , example, interest comparing one model run compares another using different assumptions e.g. input data model set . See examples . group group column used differentiate different models can factor character. total number models compared equal number unique values group. group can also length two e.g. group = c(\"model\", \"site\"). case model-site combinations shown differentiated colour/symbol first grouping variable (\"model\" case). essence plot removes differentiation second grouping variable. different values obs group, normalise = TRUE used. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. Note often make sense use type = \"site\" multiple sites available. ensure panel contains data specific individual site. normalise data normalised dividing standard deviation observations? statistics can normalised (non-dimensionalised) dividing RMS difference standard deviation mod values standard deviation observations (obs). case “observed” point plotted x-axis unit distance origin. makes possible plot statistics different species (maybe different units) plot. normalisation done group/type combination. cols Colours used plotting. Useful options categorical data available RColorBrewer colours — see openair openColours function details. Useful schemes include “Accent”, “Dark2”, “Paired”, “Pastel1”, “Pastel2”, “Set1”, “Set2”, “Set3” — see ?brewer.pal maximum useful colours . user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). rms.col Colour centred-RMS lines text. cor.col Colour correlation coefficient lines text. arrow.lwd Width arrow used used comparing two model outputs. annotate Annotation shown RMS error. text.obs plot annotation observed values; default \"observed\". key key shown? key.title Title key. key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.pos Position key e.g. “top”, “bottom”, “left” “right”. See details lattice:xyplot details finer control. strip strip shown? auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto cutData lattice:xyplot. example, TaylorDiagram passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common graphical parameters, layout panel arrangement pch cex plot symbol type size, passed xyplot. passed unmodified, although special cases openair may locally manage process. example, common axis title labelling options (xlab, ylab, main) passed via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"openair object. retained, e.g., using output <- TaylorDiagram(thedata, obs = \"nox\", mod = \"mod\"), output can used recover data, reproduce rework original plot undertake analysis. example, output$data data frame consisting group, type, correlation coefficient (R), standard deviation observations measurements.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Taylor Diagram useful model evaluation tool. diagram provides way showing three complementary model performance statistics vary simultaneously. statistics correlation coefficient R, standard deviation (sigma) (centred) root-mean-square error. three statistics can plotted one (2D) graph way related one another can represented Law Cosines. openair version Taylor Diagram several enhancements increase flexibility. particular, straightforward way producing conditioning plots prove valuable many circumstances (using type option). Many examples Taylor Diagrams focus model-observation comparisons several models using available data. However, insight can gained model performance partitioning data various ways e.g. season, daylight/nighttime, day week, levels numeric variable e.g. wind speed land-use type etc. consider several pollutants one plot, column identifying pollutant name can used e.g. pollutant. Taylor Diagram can plotted (assuming data frame thedata): TaylorDiagram(thedata, obs = \"obs\", mod = \"mod\", group = \"model\", type = \"pollutant\") give model performance pollutant panel. Note important panel represents data mean observed data across different groups. Therefore TaylorDiagram(mydata, group = \"model\", type = \"season\") OK, whereas TaylorDiagram(mydata, group = \"season\", type = \"model\") panel (representing model) four different mean values — one season. Generally, option group either missing (one model evaluated) represents column giving model name. However, data can normalised using normalise option. Normalisation carried per group/type basis making possible compare data different scales e.g. TaylorDiagram(mydata, group = \"season\", type = \"model\", normalise = TRUE). way possible compare different pollutants, sites etc. panel. Also note multiple sites present makes sense use type = \"site\" ensure panel represents individual site specific standard deviation etc. case select single site data first e.g. subset(mydata, site == \"Harwell\").","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Taylor, K.E.: Summarizing multiple aspects model performance single diagram. J. Geophys. Res., 106, 7183-7192, 2001 (also see PCMDI Report 55).","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"","code":"## in the examples below, most effort goes into making some artificial data ## the function itself can be run very simply if (FALSE) { # \\dontrun{ ## dummy model data for 2003 dat <- selectByDate(mydata, year = 2003) dat <- data.frame(date = mydata$date, obs = mydata$nox, mod = mydata$nox) ## now make mod worse by adding bias and noise according to the month ## do this for 3 different models dat <- transform(dat, month = as.numeric(format(date, \"%m\"))) mod1 <- transform(dat, mod = mod + 10 * month + 10 * month * rnorm(nrow(dat)), model = \"model 1\") ## lag the results for mod1 to make the correlation coefficient worse ## without affecting the sd mod1 <- transform(mod1, mod = c(mod[5:length(mod)], mod[(length(mod) - 3) : length(mod)])) ## model 2 mod2 <- transform(dat, mod = mod + 7 * month + 7 * month * rnorm(nrow(dat)), model = \"model 2\") ## model 3 mod3 <- transform(dat, mod = mod + 3 * month + 3 * month * rnorm(nrow(dat)), model = \"model 3\") mod.dat <- rbind(mod1, mod2, mod3) ## basic Taylor plot TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = \"model\") ## Taylor plot by season TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = \"model\", type = \"season\") ## now show how to evaluate model improvement (or otherwise) mod1a <- transform(dat, mod = mod + 2 * month + 2 * month * rnorm(nrow(dat)), model = \"model 1\") mod2a <- transform(mod2, mod = mod * 1.3) mod3a <- transform(dat, mod = mod + 10 * month + 10 * month * rnorm(nrow(dat)), model = \"model 3\") mod.dat2 <- rbind(mod1a, mod2a, mod3a) mod.dat$mod2 <- mod.dat2$mod ## now we have a data frame with 3 models, 1 set of observations ## and TWO sets of model predictions (mod and mod2) ## do for all models TaylorDiagram(mod.dat, obs = \"obs\", mod = c(\"mod\", \"mod2\"), group = \"model\") } # } if (FALSE) { # \\dontrun{ ## all models, by season TaylorDiagram(mod.dat, obs = \"obs\", mod = c(\"mod\", \"mod2\"), group = \"model\", type = \"season\") ## consider two groups (model/month). In this case all months are shown by model ## but are only differentiated by model. TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = c(\"model\", \"month\")) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests for trends using Theil-Sen estimates — TheilSen","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"Theil-Sen slope estimates tests trend.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"","code":"TheilSen( mydata, pollutant = \"nox\", deseason = FALSE, type = \"default\", avg.time = \"month\", statistic = \"mean\", percentile = NA, data.thresh = 0, alpha = 0.05, dec.place = 2, xlab = \"year\", lab.frac = 0.99, lab.cex = 0.8, x.relation = \"same\", y.relation = \"same\", data.col = \"cornflowerblue\", trend = list(lty = c(1, 5), lwd = c(2, 1), col = c(\"red\", \"red\")), text.col = \"darkgreen\", slope.text = NULL, cols = NULL, shade = \"grey95\", auto.text = TRUE, autocor = FALSE, slope.percent = FALSE, date.breaks = 7, date.format = NULL, plot = TRUE, silent = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"mydata data frame containing field date least one parameter trend test required; typically (necessarily) pollutant. pollutant parameter trend test required. Mandatory. deseason data de-deasonalized first? TRUE function stl used (seasonal trend decomposition using loess). Note TRUE missing data first imputed using Kalman filter Kalman smooth. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. avg.time Can “month” (default), “season” “year”. Determines time data averaged. Note “year”, six years required. “season” data split spring: March, April, May etc. Note December considered belonging winter following year. statistic Statistic used calculating monthly values. Default “mean”, can also “percentile”. See timeAverage details. percentile Single percentile value use statistic = \"percentile\" chosen. data.thresh data capture threshold use (%) aggregating data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. alpha confidence interval calculations slope. default 0.05. show 99\\ trend, choose alpha = 0.01 etc. dec.place number decimal places display trend estimate . default 2. xlab x-axis label, default \"year\". lab.frac Fraction along y-axis trend information printed , default 0.99. lab.cex Size text trend information. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. data.col Colour name data trend list containing information line width, line type line colour main trend line confidence intervals respectively. text.col Colour name slope/uncertainty numeric estimates slope.text text shown slope (default ‘units/year’). cols Predefined colour scheme, currently enabled \"greyscale\". shade colour used marking alternate years. Use “white” “transparent” remove shading. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. autocor autocorrelation considered trend uncertainty estimates? default FALSE. Generally, accounting autocorrelation increases uncertainty trend estimate — sometimes large amount. slope.percent slope slope uncertainties expressed percentage change per year? default FALSE slope expressed average units/year change e.g. ppb. Percentage changes can often confusing clearly defined. percentage change expressed 100 * (C.end/C.start - 1) / (end.year - start.year). C.start concentration start date C.end concentration end date. avg.time = \"year\" (end.year - start.year) total number years - 1. example, given concentration year 1 100 units percentage reduction 5%/yr, 5 years 75 units actual time span 6 years .e. year 1 used reference year. Things slightly different monthly values e.g. avg.time = \"month\", use total number months basis time span therefore able deal partial years. can slight differences %/yr trend estimate therefore, depending whether monthly annual values considered. date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . date.format option controls date format x-axis. TheilSen generally sets date format sensibly can situations user wishes control. format types see strptime. example, format date like “Jan-2012” set date.format = \"%b-%Y\". plot plot produced? FALSE can useful analysing data extract trend components plotting ways. silent FALSE function give updates trend-fitting progress. ... graphical parameters passed onto cutData lattice:xyplot. example, TheilSen passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"openair object. data component TheilSen output includes two subsets: main.data, monthly data res2 trend statistics. output <- TheilSen(mydata, \"nox\"), can extracted object$data$main.data object$data$res2, respectively. Note: case intercept, assumed y-axis crosses x-axis 1/1/1970.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"TheilSen function provides collection functions analyse trends air pollution data. TheilSen function flexible sense can applied data many ways e.g. day week, hour day wind direction. flexibility makes much easier draw inferences data e.g. strong downward trend concentration one wind sector another, trends one day week certain time day unexpected. data strongly seasonal, perhaps background site, pollutant ozone, important deseasonalise data (using option deseason = TRUE.Similarly, data increase, decrease, show sharp changes may better use smoothTrend. minimum 6 points required trend estimates made. Note! since version 0.5-11 openair uses Theil-Sen derive p values also slope. ensure consistency calculated p value trend parameters .e. slope estimates uncertainties. p value uncertainties calculated bootstrap simulations. Note symbols shown next trend estimate relate statistically significant trend estimate : p $<$ 0.001 = ***, p $<$ 0.01 = **, p $<$ 0.05 = * p $<$ 0.1 = $+$. code used TheilSen based Rand Wilcox. mostly relates Theil-Sen slope estimates uncertainties. modifications made take account correlated data based Kunsch (1989). basic function adapted take account auto-correlated data using block bootstrap simulations autocor = TRUE (Kunsch, 1989). follow suggestion Kunsch (1989) setting block length n(1/3) n length time series. slope estimate confidence intervals slope plotted numerical information presented.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"Helsel, D., Hirsch, R., 2002. Statistical methods water resources. US Geological Survey. Note good resource statistics applied environmental data. Hirsch, R. M., Slack, J. R., Smith, R. ., 1982. Techniques trend analysis monthly water-quality data. Water Resources Research 18 (1), 107-121. Kunsch, H. R., 1989. jackknife bootstrap general stationary observations. Annals Statistics 17 (3), 1217-1241. Sen, P. K., 1968. Estimates regression coefficient based Kendall's tau. Journal American Statistical Association 63(324). Theil, H., 1950. rank invariant method linear polynomial regression analysis, , ii, iii. Proceedings Koninklijke Nederlandse Akademie Wetenschappen, Series - Mathematical Sciences 53, 386-392, 521-525, 1397-1412. ... see also several Air Quality Expert Group (AQEG) reports use similar tests applied UK/European air quality data.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"David Carslaw trend code Rand Wilcox","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"","code":"# trend plot for nox TheilSen(mydata, pollutant = \"nox\") #> Taking bootstrap samples. Please wait. # trend plot for ozone with p=0.01 i.e. uncertainty in slope shown at # 99 % confidence interval if (FALSE) TheilSen(mydata, pollutant = \"o3\", ylab = \"o3 (ppb)\", alpha = 0.01) # \\dontrun{} # trend plot by each of 8 wind sectors if (FALSE) TheilSen(mydata, pollutant = \"o3\", type = \"wd\", ylab = \"o3 (ppb)\") # \\dontrun{} # and for a subset of data (from year 2000 onwards) if (FALSE) TheilSen(selectByDate(mydata, year = 2000:2005), pollutant = \"o3\", ylab = \"o3 (ppb)\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate summary statistics for air pollution data by year — aqStats","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"Calculate range air pollution-relevant statistics year.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"","code":"aqStats( mydata, pollutant = \"no2\", type = \"default\", data.thresh = 0, percentile = c(95, 99), transpose = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"mydata data frame containing date field hourly data. pollutant name pollutant e.g. pollutant = c(\"o3\", \"pm10\"). type type allows timeAverage() applied cases groups data need split function applied group. common example data multiple sites identified column representing site name e.g. type = \"site\". generally, type used date repeats particular grouping variable. data.thresh data capture threshold %. values calculated data capture period interest less value. data.thresh used example calculation daily mean values hourly data. less data.thresh percentage measurements available period, NA returned. percentile Percentile values calculate pollutant. transpose default return data frame columns representing statistics. transpose = TRUE results columns pollutant-site combination. ... arguments, currently unused.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"function calculates range common air pollution-specific statistics data frame. statistics calculated annual basis input assumed hourly data. function can cope several sites years e.g. using type = \"site\". user can control output setting transpose appropriately. Note input data assumed mass units e.g. ug/m3 species except CO (mg/m3). following statistics calculated: data.capture — percentage data capture full year. mean — annual mean. minimum — minimum hourly value. maximum — maximum hourly value. median — median value. max.daily — maximum daily mean. max.rolling.8 — maximum 8-hour rolling mean. max.rolling.24 — maximum 24-hour rolling mean. percentile.95 — 95th percentile. Note several percentiles can calculated. roll.8.O3.gt.100 — number days daily maximum rolling 8-hour mean ozone concentration >100 ug/m3. target value. roll.8.O3.gt.120 — number days daily maximum rolling 8-hour mean ozone concentration >120 ug/m3. Limit Value exceeded > 10 days year. AOT40 — accumulated amount ozone threshold value 40 ppb daylight hours growing season (April September). Note latitude longitude can also passed calculation. hours.gt.200 — number hours NO2 200 ug/m3. days.gt.50 — number days PM10 50 ug/m3. rolling means, user can supply option align, can \"centre\" (default), \"left\" \"right\". See rollingMean details. can small discrepancies AURN due treatment rounding data. aqStats function round, whereas AURN data can rounded several stages calculations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"","code":"## Statistics for 2004. NOTE! these data are in ppb/ppm so the ## example is for illustrative purposes only aqStats(selectByDate(mydata, year = 2004), pollutant = \"no2\") #> # A tibble: 1 × 15 #> # Groups: default, pollutant, year [1] #> default pollutant year date dat.cap mean min max median #> #> 1 01 Janua… no2 2004 2004-01-01 00:00:00 99.8 55.0 0 185 51 #> # ℹ 6 more variables: max_daily , roll_8_max , roll_24_max , #> # percentile.95 , percentile.99 , hours "},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":null,"dir":"Reference","previous_headings":"","what":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"Bin variable calculate mean uncertainties mean","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"","code":"binData(mydata, bin = \"nox\", uncer = \"no2\", n = 40, interval = NA, breaks = NA)"},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"mydata Name data frame process. bin name column divide intervals uncer name column mean, lower upper uncertainties calculated interval bin. n number intervals split bin . interval interval used binning data. breaks User specified breaks use binning.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"Returns summarised data frame new columns mean upper / lower 95 percent confidence intervals mean.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"function summarises data intervals calculates mean bootstrap 95 % confidence intervals mean chosen variable data frame. numeric variables summarised mean intervals. three options binning. default bon bin 40 intervals. Second, user can choose binning interval e.g. interval = 5. Third, user can supply breaks use binning intervals.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"","code":"# how does nox vary by intervals of wind speed? results <- binData(mydata, bin = \"ws\", uncer = \"nox\") # easy to plot this using ggplot2 if (FALSE) { # \\dontrun{ library(ggplot2) ggplot(results, aes(ws, mean, ymin = min, ymax = max)) + geom_pointrange() } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":null,"dir":"Reference","previous_headings":"","what":"Bootsrap confidence intervals in the mean — bootMeanDF","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"utility function calculation uncertainty intervals mean vector. function removes missing data calculation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"","code":"bootMeanDF(x, conf.int = 0.95, B = 1000)"},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"x vector mean bootstrap confidence intervals mean calculated conf.int confidence interval; default = 0.95. B number bootstrap simulations","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"Returns data frame mean, lower uncertainty, upper uncertainty number values used calculation","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"","code":"test <- rnorm(20, mean = 10) bootMeanDF(test) #> mean min max n #> Mean 9.959414 9.591018 10.3094 20"},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"Given hourly NOX NO2 roadside site hourly NOX, NO2 O3 background site function estimate emissions ratio NO2/NOX — level primary NO2","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"","code":"calcFno2(input, tau = 60, user.fno2, main = \"\", xlab = \"year\", ...)"},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"input data frame following fields. nox andno2 (roadside NOX NO2 concentrations), back_nox, back_no2 back_o3 (hourly background concentrations pollutant). addition temp (temperature degrees Celsius) cl (cloud cover Oktas). Note temp cl available, typical means values 11 deg. C cloud = 3.5 used. tau Mixing time scale. unlikely user need adjust . See details . user.fno2 User-supplied f-NO2 fraction e.g. 0.1 NO2/NOX ratio 10% volume. user.no2 applied whole time series useful testing \"\" questions. main Title plot required. xlab x-axis label. ... Arguments passed scatterPlot mydata data frame containing least two numeric variables plot. x Name x-variable plot. Note x can date field factor. example, x can one openair built types \"year\" \"season\". y Name numeric y-variable plot. z Name numeric z-variable plot method = \"scatter\" method = \"level\". Note method = \"scatter\" points coloured according continuous colour scale, whereas method = \"level\" surface coloured. method Methods include “scatter” (conventional scatter plot), “hexbin” (hexagonal binning using hexbin package). “level” binned smooth surface plot “density” (2D kernel density estimates). group grouping variable use, . Setting variable data frame effect plotting several series panel using different symbols/colours etc. set variable character factor, categories factor levels used directly. set numeric variable, split variable quantiles. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". See function timeAverage details . option se useful one method number points plotted reduced .e. choosing longer averaging time. data.thresh data capture threshold use (\\ data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". statistic statistic apply aggregating data; default mean. Can one \"mean\", \"max\", \"min\", \"median\", \"frequency\", \"sd\", \"percentile\". Note \"sd\" standard deviation \"frequency\" number (frequency) valid records period. \"percentile\" percentile level (\\ \"percentile\" option - see . used avg.time = \"default\". percentile percentile level percent used statistic = \"percentile\" aggregating data avg.time. default 95. used avg.time = \"default\". type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. smooth smooth line fitted data TRUE; optionally 95 percent confidence intervals shown. method = \"level\" smooth surface fitted binned data. spline smooth spline fitted data TRUE. particularly useful fewer data points connection line sequence points required. linear linear model fitted data TRUE; optionally 95 percent confidence intervals shown. equation line R2 value also shown. ci confidence intervals smooth/linear fit shown? mod.line TRUE three lines added scatter plot help inform model evaluation. 1:1 line solid 1:0.5 1:2 lines dashed. Together lines help show close group points 1:1 relationship also show points within factor two (FAC2). mod.line appropriately transformed x y axes log scale. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") plot.type lattice plot type. Can “p” (points — default), “l” (lines) “b” (lines points). key key drawn? default TRUE. key.title title key (used). key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. strip strip drawn? default TRUE. log.x x-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. log.y y-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. x.inc x-interval used binning data method = \"level\". y.inc y-interval used binning data method = \"level\". limits method = \"level\" function best choose sensible limits automatically. However, circumstances user wish set different ones. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. windflow option allows scatter plot show wind speed/direction shows arrow. option list e.g. windflow = list(col = \"grey\", lwd = 2, scale = 0.1). option requires wind speed (ws) wind direction (wd) available. maximum length arrow plotted fraction plot dimension longest arrow scale plot x-y dimension. Note, plot size adjusted manually user re-plotted ensure correct wind angle. list may contain options panel.arrows lattice package. useful options include length, controls length arrow head angle, controls angle arrow head. option works best many data ensure -plotting become problem. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. k Smoothing parameter supplied gam fitting smooth surface method = \"level\". dist plotting smooth surfaces (method = \"level\" smooth = TRUE, dist controls far original data predictions made. See exclude..far mgcv package. Data first transformed unit square. Values 0 1. map base map drawn? option development. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"principal purpose function estimate level primary (direct) NO2 road vehicles. hourly data NOX, NO2 O3 available, total oxidant method Clapp Jenkin (2001) can used. roadside O3 measurements available see linearRelation() details estimate primary NO2 fraction. absence roadside O3 measurements, rather problematic calculate fraction primary NO2. Carslaw Beevers (2005c) developed approach based linearRelation() analysis roadside background measurements. increment roadside NO2 concentrations primarily determined direct emissions NO2 availability One react form NO2. method aims quantify amount NO2 formed two processes seeking optimum level primary NO2 gives least error. Test data provided https://davidcarslaw.github.io/openair/.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"Clapp, L.J., Jenkin, M.E., 2001. Analysis relationship ambient levels O3, NO2 function NOX UK. Atmospheric Environment 35 (36), 6391-6405. Carslaw, D.C. N Carslaw (2007). Detecting characterising small changes urban nitrogen dioxide concentrations. Atmospheric Environment. Vol. 41, 4723-4733. Carslaw, D.C., Beevers, S.D. M.C. Bell (2007). Risks exceeding hourly EU limit value nitrogen dioxide resulting increased road transport emissions primary nitrogen dioxide. Atmospheric Environment 41 2073-2082. Carslaw, D.C. (2005a). Evidence increasing NO2/NOX emissions ratio road traffic emissions. Atmospheric Environment, 39(26) 4793-4802. Carslaw, D.C. Beevers, S.D. (2005b). Development urban inventory road transport emissions NO2 comparison estimates derived ambient measurements. Atmospheric Environment, (39): 2049-2059. Carslaw, D.C. Beevers, S.D. (2005c). Estimations road vehicle primary NO2 exhaust emission fractions using monitoring data London. Atmospheric Environment, 39(1): 167-177. Carslaw, D. C. S. D. Beevers (2004). Investigating Potential Importance Primary NO2 Emissions Street Canyon. Atmospheric Environment 38(22): 3585-3594. Carslaw, D. C. S. D. Beevers (2004). New Directions: road vehicle emissions legislation consider primary NO2? Atmospheric Environment 38(8): 1233-1234.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate percentile values from a time series — calcPercentile","title":"Calculate percentile values from a time series — calcPercentile","text":"Calculates multiple percentile values time series, flexible time aggregation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate percentile values from a time series — calcPercentile","text":"","code":"calcPercentile( mydata, pollutant = \"o3\", avg.time = \"month\", percentile = 50, data.thresh = 0, start = NA )"},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate percentile values from a time series — calcPercentile","text":"mydata data frame data date field format Date POSIXct. Must one variable apply calculations . pollutant Name variable process. Mandatory. avg.time Averaging period use. See timeAverage() details. percentile vector percentile values. example percentile = 50 median values, percentile = c(5, 50, 95 multiple percentile values. data.thresh Data threshold apply aggregating data. See timeAverage() details. start Start date use - see timeAverage() details.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate percentile values from a time series — calcPercentile","text":"Returns data frame new columns percentile level. New columns given names like percentile.95 e.g. percentile = 95 chosen. See examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate percentile values from a time series — calcPercentile","text":"utility function calculate percentiles used , example, timePlot. Given data frame date field one numeric variable, percentiles calculated.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate percentile values from a time series — calcPercentile","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate percentile values from a time series — calcPercentile","text":"","code":"# 95th percentile monthly o3 concentrations percentiles <- calcPercentile(mydata, pollutant =\"o3\", avg.time = \"month\", percentile = 95) head(percentiles) #> date percentile.95 #> 1 1998-01-01 14 #> 2 1998-02-01 7 #> 3 1998-03-01 15 #> 4 1998-04-01 20 #> 5 1998-05-01 25 #> 6 1998-06-01 15 # 5, 50, 95th percentile monthly o3 concentrations if (FALSE) { # \\dontrun{ percentiles <- calcPercentile(mydata, pollutant =\"o3\", avg.time = \"month\", percentile = c(5, 50, 95)) head(percentiles) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot time series values in a conventional calendar format — calendarPlot","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"function plot data month laid conventional calendar format. main purpose help rapidly visualise potentially complex data familiar way. Users can also choose show daily mean wind vectors wind speed direction available.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"","code":"calendarPlot( mydata, pollutant = \"nox\", year = 2003, month = 1:12, type = \"default\", annotate = \"date\", statistic = \"mean\", cols = \"heat\", limits = c(0, 100), lim = NULL, col.lim = c(\"grey30\", \"black\"), col.arrow = \"black\", font.lim = c(1, 2), cex.lim = c(0.6, 1), digits = 0, data.thresh = 0, labels = NA, breaks = NA, w.shift = 0, w.abbr.len = 1, remove.empty = TRUE, main = NULL, key.header = \"\", key.footer = \"\", key.position = \"right\", key = TRUE, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"mydata data frame minimally containing date least one numeric variable. date either Date format class POSIXct. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". year Year plot e.g. year = 2003. supplied data potentially spanning several years plotted. month certain month required. default function plot entire year even months missing. plot certain months use month option month numeric 1:12 e.g. month = c(1, 12) plot January December. type yet implemented. annotate option controls appears day calendar. Can : \"date\" — shows day month; \"wd\" — shows vector-averaged wind direction, \"ws\" — shows vector-averaged wind direction scaled wind speed. Finally can “value” shows daily mean value. statistic Statistic passed timeAverage(). Note statistic = \"max\" annotate \"ws\" \"wd\", hour corresponding maximum concentration polluant used provide associated ws wd maximum daily ws wd. cols Colours used plotting. See openColours() details. limits Use option manually set colour scale limits. useful case need two plots consistent scale needed . Set limits cover maximum range data plots interest. example, one plot data covering 0–60 another 0–100, set limits = c(0, 100). Note data ignored outside limits range. lim threshold value help differentiate values lim. used annotate = \"value\". See next options control labels used. col.lim annotation concentration labels day. first sets colour text lim second sets colour text lim. col.arrow colour annotated wind direction / wind speed arrows. font.lim annotation concentration labels day. first sets font text lim second sets font text lim. Note font = 1 normal text font = 2 bold text. cex.lim annotation concentration labels day. first sets size text lim second sets size text lim. digits number digits used display concentration values annotate = \"value\". data.thresh Data capture threshold passed timeAverage(). example, data.thresh = 75 means least 75\\ available day value calculate, else data removed. labels categorical scale defined using breaks, labels can used override default category labels, e.g., labels = c(\"good\", \"bad\", \"bad\"). Note one less label break. breaks categorical scale required breaks used. example, breaks = c(0, 50, 100, 1000). case “good” corresponds values 0 50 . Users set maximum value breaks exceed maximum data value ensure within maximum final range e.g. 100–1000 case. w.shift Controls order days week. default plot shows Saturday first (w.shift = 0). change starts Monday example, set w.shift = 2, . w.abbr.len default (1) abbreviates days week single letter (e.g., English, S/S/M/T/W/T/F). w.abbr.len defines number letters abbreviate . example, w.abbr.len = 3 abbreviate \"Monday\" \"Mon\". remove.empty months data present removed? Default TRUE. main plot title; default pollutant year. key.header Adds additional text/labels scale key. example, passing calendarPlot(mydata, key.header = \"header\", key.footer = \"footer\") adds addition text scale key. arguments passed drawOpenKey() via quickText(), applying auto.text argument, handle formatting. key.footer see key.header. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey(). See drawOpenKey() details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract calendar plot components plotting ways. ... graphical parameters passed onto lattice function lattice::levelplot(), common axis title labelling options (xlab, ylab, main) passed via quickText() handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"calendarPlot() plot data conventional calendar format, .e., month day week. Daily statistics calculated using timeAverage(), default calculate daily mean concentration. wind direction available possible plot wind direction vector day. useful getting feel meteorological conditions affect pollutant concentrations. Note hourly higher time resolution supplied, calendarPlot() calculate daily averages using timeAverage(), ensures wind directions vector-averaged. wind speed also available, setting option annotate = \"ws\" plot wind vectors whose length scaled wind speed. Thus information daily mean wind speed direction available. also possible plot categorical scales. useful , example, air quality index defines concentrations bands, e.g., \"good\", \"poor\". cases users must supply labels corresponding breaks. Note possible pre-calculate concentrations way passing data calendarPlot(). example rollingMean() used calculate rolling 8-hour mean concentrations. data can passed calendarPlot() statistic = \"max\" chosen, plot maximum daily 8-hour mean concentrations.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"","code":"# basic plot calendarPlot(mydata, pollutant = \"o3\", year = 2003) # show wind vectors calendarPlot(mydata, pollutant = \"o3\", year = 2003, annotate = \"wd\") if (FALSE) { # \\dontrun{ # show wind vectors scaled by wind speed and different colours calendarPlot(mydata, pollutant = \"o3\", year = 2003, annotate = \"ws\", cols = \"heat\" ) # show only specific months with selectByDate calendarPlot(selectByDate(mydata, month = c(3, 6, 10), year = 2003), pollutant = \"o3\", year = 2003, annotate = \"ws\", cols = \"heat\" ) # categorical scale example calendarPlot(mydata, pollutant = \"no2\", breaks = c(0, 50, 100, 150, 1000), labels = c(\"Very low\", \"Low\", \"High\", \"Very High\"), cols = c(\"lightblue\", \"green\", \"yellow\", \"red\"), statistic = \"max\" ) # UK daily air quality index pm10.breaks <- c(0, 17, 34, 50, 59, 67, 75, 84, 92, 100, 1000) calendarPlot(mydata, \"pm10\", year = 1999, breaks = pm10.breaks, labels = c(1:10), cols = \"daqi\", statistic = \"mean\", key.header = \"DAQI\" ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"function enhances conditionalQuantile() also considering variables vary intervals. Conditional quantiles useful model evaluation, provide direct information variables change time. example, conditional quantile plot ozone concentrations may show low concentrations ozone tend -predicted. However, cause -prediction can difficult determine. However, considering well model predicts variables intervals, insight can gained underlying reasons model performance poor.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"","code":"conditionalEval( mydata, obs = \"obs\", mod = \"mod\", var.obs = \"var.obs\", var.mod = \"var.mod\", type = \"default\", bins = 31, statistic = \"MB\", xlab = \"predicted value\", ylab = \"statistic\", col = brewer.pal(5, \"YlOrRd\"), col.var = \"Set1\", var.names = NULL, auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"mydata data frame containing field obs mod representing observed modelled values. obs name observations mydata. mod name predictions (modelled values) mydata. var.obs variable observations statistics calculated. Can length one e.g. var.obs = c(\"nox.obs\", \"ws.obs\"). Note including variables reduce number data available plot due need non-missing data variables. var.mod variable predictions statistics calculated. Can length one e.g. var.obs = c(\"nox.obs\", \"ws.obs\"). type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. \"season\", \"year\", \"weekday\" . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. bins Number bins used calculating different quantile levels. statistic Statistic(s) plotted. Can “MB”, “NMB”, “r”, “COE”, “MGE”, “NMGE”, “RMSE” “FAC2”, described modStats. statistics chosen, calculated var.mod var.mod. statistic can also value can supplied cutData. example, statistic = \"season\" show model performance varies season across distribution predictions might highlight high concentrations NOx model tends underestimate concentrations periods mostly occur winter. statistic can also another variable data frame — see cutData information. special case statistic = \"cluster\" clusters calculated using trajCluster. xlab label x-axis, default “predicted value”. ylab label y-axis, default “observed value”. col Colours used plotting uncertainty bands median line. Must length 5 . col.var Colours additional variables compared. See openColours details. var.names Variable names shown plot plotting var.obs var.mod. auto.text Either TRUE (default) FALSE. TRUE titles axis labels etc. automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto conditionalQuantile cutData. example, conditionalQuantile passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"conditionalEval function provides information variables vary across intervals shown conditional quantile plot. two types variable can considered setting value statistic. First, statistic can another variable data frame. case plot show different proportions statistic across range predictions. example statistic = \"season\" show interval mod proportion predictions spring, summer, autumn winter. useful model performance worse example high concentrations mod knowing tend occur particular season etc. can helpful trying understand model fails. See cutData() details types variable can statistic. Another example statistic = \"ws\" (wind speed available data frame), split wind speed four quantiles plot proportions . Second, conditionalEval can simultaneously plot model performance observed/predicted variable pairs according different model evaluation statistics. statistics derive modStats() function include “MB”, “NMB”, “r”, “COE”, “MGE”, “NMGE”, “RMSE” “FAC2”. one statistic can supplied e.g. statistic = c(\"NMB\", \"COE\"). Bootstrap samples taken corresponding values variables plotted statistics 95\\ intervals calculated. case, model performance variables shown across intervals mod, rather just values single variables. second case model need provide observed/predicted pairs variables. example, model may provide predictions NOx wind speed (also observations available). conditionalEval function show well variables predicted intervals main variables assessed conditional quantile e.g. ozone. case, values supplied var.obs (observed values variables) var.mod (modelled values variables). example, consider well model predicts NOx wind speed var.obs = c(\"nox.obs\", \"ws.obs\") var.mod = c(\"nox.mod\", \"ws.mod\") supplied (assuming nox.obs, nox.mod, ws.obs, ws.mod present data frame). analysis show example, ozone concentrations -predicted, model may also shown -predict concentrations NOx time, -predict wind speeds. information can thus help identify underlying causes poor model performance. example, -prediction wind speed result higher surface NOx concentrations lower ozone concentrations. Similarly wind speed predictions good NOx predicted might suggest -estimate NOx emissions. One additional variables can plotted. special case statistic = \"cluster\". case data frame provided contains cluster calculated trajCluster() importTraj(). Alternatively users supply pre-calculated clusters. calculations can useful showing whether certain back trajectory clusters associated poor (good) model performance. Note case statistic = \"cluster\" fewer data points used analysis compared ordinary statistics trajectories available every three hours. Also note statistic = \"cluster\" used together ordinary model evaluation statistics MB. output bar chart showing proportion interval mod cluster number. Far insight can gained model performance conditioning using type. example, type = \"season\" plot conditional quantiles associated model performance statistics variables season. type can also factor character field e.g. representing different models used. See Wilks (2005) details conditional quantile plots.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"Wilks, D. S., 2005. Statistical Methods Atmospheric Sciences, Volume 91, Second Edition (International Geophysics), 2nd Edition. Academic Press.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional quantile estimates for model evaluation — conditionalQuantile","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Function calculate conditional quantiles flexible conditioning. function use model evaluation generally help better understand forecast predictions well agree observations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"","code":"conditionalQuantile( mydata, obs = \"obs\", mod = \"mod\", type = \"default\", bins = 31, min.bin = c(10, 20), xlab = \"predicted value\", ylab = \"observed value\", col = brewer.pal(5, \"YlOrRd\"), key.columns = 2, key.position = \"bottom\", auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"mydata data frame containing field obs mod representing observed modelled values. obs name observations mydata. mod name predictions (modelled values) mydata. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. bins Number bins used calculating different quantile levels. min.bin minimum number points required estimates 25/75th 10/90th percentiles. xlab label x-axis, default “predicted value”. ylab label y-axis, default “observed value”. col Colours used plotting uncertainty bands median line. Must length 5 . key.columns Number columns used key. key.position Location key e.g. “top”, “bottom”, “right”, “left”. See lattice xyplot details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels etc. automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto cutData lattice:xyplot. example, conditionalQuantile passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Conditional quantiles useful way considering model performance observations continuous measurements (Wilks, 2005). conditional quantile plot splits data evenly spaced bins. predicted value bin e.g. 0 10~ppb corresponding values observations identified median, 25/75th 10/90 percentile (quantile) calculated bin. data plotted show values vary across bins. time series observations predictions agree precisely median value predictions equal observations bin. conditional quantile plot differs quantile-quantile plot (Q-Q plot) often used compare observations predictions. Q-Q~plot separately considers distributions observations predictions, whereas conditional quantile uses corresponding observations particular interval predictions. Take example two time series, first series real observations second lagged time series observations representing predictions. two time series identical (nearly identical) distributions (e.g. median, minimum maximum). Q-Q plot show straight line showing perfect agreement, whereas conditional quantile . interval predictions corresponding observations now different values. Plotting data way shows well predictions agree observations can help reveal many useful characteristics well model predictions agree observations — across full distribution values. single plot can therefore convey considerable amount information concerning model performance. conditionalQuantile function openair allows conditional quantiles considered flexible way e.g. considering vary season. function requires data frame consisting column observations column predictions. observations split bins according values predictions. median prediction line together 25/75th 10/90th quantile values plotted together line showing “perfect” model. Also shown histogram predicted values (shaded grey) histogram observed values (shown blue line). Far insight can gained model performance conditioning using type. example, type = \"season\" plot conditional quantiles season. type can also factor character field e.g. representing different models used. See Wilks (2005) details examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Murphy, . H., B.G. Brown Y. Chen. (1989) Diagnostic Verification Temperature Forecasts, Weather Forecasting, Volume: 4, Issue: 4, Pages: 485-501. Wilks, D. S., 2005. Statistical Methods Atmospheric Sciences, Volume 91, Second Edition (International Geophysics), 2nd Edition. Academic Press.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"","code":"## make some dummy prediction data based on 'nox' mydata$mod <- mydata$nox * 1.1 + mydata$nox * runif(1:nrow(mydata)) # basic conditional quantile plot ## A \"perfect\" model is shown by the blue line ## predictions tend to be increasingly positively biased at high nox, ## shown by departure of median line from the blue one. ## The widening uncertainty bands with increasing NOx shows that ## hourly predictions are worse for higher NOx concentrations. ## Also, the red (median) line extends beyond the data (blue line), ## which shows in this case some predictions are much higher than ## the corresponding measurements. Note that the uncertainty bands ## do not extend as far as the median line because there is insufficient # to calculate them conditionalQuantile(mydata, obs = \"nox\", mod = \"mod\") ## can split by season to show seasonal performance (not very ## enlightening in this case - try some real data and it will be!) if (FALSE) { # \\dontrun{ conditionalQuantile(mydata, obs = \"nox\", mod = \"mod\", type = \"season\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlation matrices with conditioning — corPlot","title":"Correlation matrices with conditioning — corPlot","text":"Function draw visualise correlation matrices using lattice. primary purpose tool exploratory data analysis. Hierarchical clustering used group similar variables.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlation matrices with conditioning — corPlot","text":"","code":"corPlot( mydata, pollutants = NULL, type = \"default\", cluster = TRUE, method = \"pearson\", use = \"pairwise.complete.obs\", dendrogram = FALSE, lower = FALSE, cols = \"default\", r.thresh = 0.8, text.col = c(\"black\", \"black\"), auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlation matrices with conditioning — corPlot","text":"mydata data frame consist numeric columns. pollutants names data-series mydata plotted corPlot. default option NULL alternative “” use available valid (numeric) data. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. cluster data ordered according cluster analysis. TRUE hierarchical clustering applied correlation matrices using hclust group similar variables together. many variables clustering can greatly assist interpretation. method correlation method use. Can “pearson”, “spearman” “kendall”. use handle missing values cor function. default \"pairwise.complete.obs\". Care taken choice handle missing data considering pair-wise correlations. dendrogram dendrogram plotted? TRUE dendrogram shown right plot. Note work type = \"default\". lower lower triangle plotted? cols Colours used plotting. Options include “default”, “increment”, “heat”, “spectral”, “hue”, “greyscale” user defined (see openColours details). r.thresh Values greater r.thresh shown bold type. helps highlight high correlations. text.col colour text used show correlation values. first value controls colour negative correlations second positive. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract corPlot components plotting ways. ... graphical parameters passed onto lattice:levelplot, common axis title labelling options (xlab, ylab, main) passed via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correlation matrices with conditioning — corPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlation matrices with conditioning — corPlot","text":"corPlot function plots correlation matrices. implementation relies heavily shown Sarkar (2007), extensions. Correlation matrices effective way understating relationships many variables. corPlot shows correlation coded three ways: shape (ellipses), colour numeric value. ellipses can thought visual representations scatter plot. perfect positive correlation line 45 degrees positive slope drawn. zero correlation shape becomes circle. See examples . many different variables can difficult see relationships variables, .e., variables tend behave like one another. reason hierarchical clustering applied correlation matrices group variables similar one another (cluster = TRUE). clustering chosen also possible add dendrogram using option dendrogram = TRUE. Note dendrogramscan plotted type = \"default\" .e. single panel. dendrogram can also recovered plot object plotted clearly; see examples . also possible use openair type option condition data many flexible ways, although may become difficult visualise many panels.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlation matrices with conditioning — corPlot","text":"Sarkar, D. (2007). Lattice Multivariate Data Visualization R. New York: Springer. Friendly, M. (2002). Corrgrams : Exploratory displays correlation matrices. American Statistician, 2002(4), 1-16. doi:10.1198/000313002533","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlation matrices with conditioning — corPlot","text":"David Carslaw — mostly based code contained Sarkar (2007)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correlation matrices with conditioning — corPlot","text":"","code":"## basic corrgram plot corPlot(mydata) ## plot by season ... and so on corPlot(mydata, type = \"season\") ## recover dendrogram when cluster = TRUE and plot it res <-corPlot(mydata) plot(res$clust) if (FALSE) { # \\dontrun{ ## a more interesting are hydrocarbon measurements hc <- importAURN(site = \"my1\", year = 2005, hc = TRUE) ## now it is possible to see the hydrocarbons that behave most ## similarly to one another corPlot(hc) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to split data in different ways for conditioning — cutData","title":"Function to split data in different ways for conditioning — cutData","text":"Utility function split data frames various ways conditioning plots. Users generally expected call function directly. Widely used many openair functions usually option type.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to split data in different ways for conditioning — cutData","text":"","code":"cutData( x, type = \"default\", hemisphere = \"northern\", n.levels = 4, start.day = 1, is.axis = FALSE, local.tz = NULL, latitude = 51, longitude = -0.5, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to split data in different ways for conditioning — cutData","text":"x data frame containing field date. type string giving way data frame split. Pre-defined values : “default”, “year”, “hour”, “month”, “season”, “weekday”, “site”, “weekend”, “monthyear”, “daylight”, “dst” (daylight saving time). type can also name numeric factor. numeric column name supplied cutData split data four quantiles. Factors levels used split data without adjustment. hemisphere Can \"northern\" \"southern\", used split data seasons. n.levels Number quantiles split numeric data . start.day day week type = \"weekday\" start ? user can change start day supplying integer 0 6. Sunday = 0, Monday = 1, ... example start weekday plots Saturday, choose start.day = 6. .axis logical (TRUE/FALSE), used request shortened cut labels axes. local.tz Used identifying whether date daylight savings time (DST) applied . Examples include local.tz = \"Europe/London\", local.tz = \"America/New_York\" .e. time zones assume DST. https://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones shows time zones valid systems. important original data GMT (UTC) fixed offset GMT. See import openair manual information import data ensure DST applied. latitude decimal latitude used type = \"daylight\". longitude decimal longitude. Note locations west Greenwich negative. ... additional parameters passed next function(s).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to split data in different ways for conditioning — cutData","text":"Returns data frame column cond defined type.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to split data in different ways for conditioning — cutData","text":"section give brief description define levels type. Note time dependent types require column date. \"default\" split data describe levels date range format \"day month year\". \"year\" splits data year. \"month\" splits data month year. \"hour\" splits data hour day. \"monthyear\" splits data year month. differs month level defined month data set. useful sometimes show ordered sequence months data set starts half way year; rather starting January. \"weekend\" splits data weekday weekend. \"weekday\" splits data day week - ordered start Monday. \"season\" splits data season. northern hemisphere winter = December, January, February; spring = March, April, May etc. definitions change hemisphere = \"southern\". \"seasonyear (\"yearseason\") split data year-season intervals, keeping months season together. example, December 2010 considered part winter 2011 (January February 2011). makes easier consider contiguous seasons. contrast, type = \"season\" just split data four seasons regardless year. \"daylight\" splits data relative estimated sunrise sunset give either daylight nighttime. cut made cutDaylight conveniently accessed via cutData, e.g. cutData(mydata, type = \"daylight\", latitude = .latitude, longitude = .longitude). daylight estimation, valid dates 1901 2099, made using measurement location, date, time astronomical algorithms estimate relative positions Sun measurement location Earth's surface, based NOAA methods. Measurement location set using latitude (+ North; - South) longitude (+ East; - West). \"dst\" split data hours daylight saving time (DST) hours appropriate time zones. option \"dst\" also requires local time zone given e.g. local.tz = \"Europe/London\", local.tz = \"America/New_York\". two periods local time. main purpose option test whether shift diurnal profile DST non-DST hours compared. option particularly useful timeVariation function. example, close source road vehicle emissions, `rush-hour' tend occur local time throughout year e.g. 8 5 pm. Therefore, comparing non-DST hours DST hours tend show similar diurnal patterns (least timing peaks, magnitude) expressed local time. contrast variable wind speed temperature show clear shift expressed local time. essence, option used timeVariation may help determine whether variation pollutant driven man-made emissions natural processes. \"wd\" splits data 8 wind sectors requires column wd: \"NE\", \"E\", \"SE\", \"S\", \"SW\", \"W\", \"NW\", \"N\". \"ws\" splits data 8 quantiles wind speed requires column ws. \"site\" splits data site therefore requires column site. Note date-based types e.g. month/year derived column date. user already column name one date-based types used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to split data in different ways for conditioning — cutData","text":"David Carslaw (cutData) Karl Ropkins (cutDaylight)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to split data in different ways for conditioning — cutData","text":"","code":"## split data by day of the week mydata <- cutData(mydata, type = \"weekday\")"},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":null,"dir":"Reference","previous_headings":"","what":"Scale key handling for openair — drawOpenKey","title":"Scale key handling for openair — drawOpenKey","text":"General function producing scale keys openair functions. function crude modification draw.colorkey function developed Deepayan Sarkar part lattice package, allows additional key labelling added, provides additional control appearance scaling.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scale key handling for openair — drawOpenKey","text":"","code":"drawOpenKey(key, draw = FALSE, vp = NULL)"},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scale key handling for openair — drawOpenKey","text":"key List defining scale key structure produced. options identical original draw.colorkey function. Original draw.colorkey options: space location scale key (\"left\", \"right\", \"top\" \"bottom\"). Defaults \"right\". col vector colours, used scale key. numeric vector specifying colors change. Must length 1 col vector. labels character vector labelling values, commonly, list describing characteristics labels. list may include components labels, , cex, col, rot, font, fontface fontfamily. tick.number approximate number ticks. width width key. height height key. Note: width height refer key dimensions. height length key along plot axis positioned , width length perpendicular . Additional options include: header character vector extra text added key, list describing characteristics header. list may include components header, character vector header labels, tweaks, list local controls, e.g. 'gap' 'balance' spacing relative scale footer, respectively, auto.text, TRUE/FALSE option apply quickText, slot, numeric vector setting size text boxes header text placed . footer header labels scale key. Notes: header footer formatting can set locally, instead matched set labels. drawOpenKey allows six additional labels (three three scale key). additional text ignored. tweak, auto.text, slot header footer sets options uniformly. also overwrites anything header /footer. fit fit method applied header, scale key footer placing scale key left right plot. Options include: '', 'soft' 'scale'. default '' fits header, key footer height range. alternative 'scale' fits key within height. (means keys keep proportions relative main plot regardless positioning header footer may exceed plot dimensions height /slots large. plot.style character vector key plotting style instructions: Options currently include: 'paddle', 'ticks' 'border'. 'paddle' applies incremental paddle layout used winRose. 'ticks' places ticks labels scale key. 'border' places border scale key. combination may used none set, scale key defaults c(\"ticks\", \"border\") plotting operations c(\"paddle\") windRose. draw Option return key object plot directly. default, FALSE, always used within openair calls. vp View port used plotting key. default, NULL, always used within openair calls. (Note: drawOpenKey crude modification lattice::draw.colorkey, provides labelling options openair plot scale keys. aspects function development may subject change. Therefore, recommended use parent openair function controls, e.g. key.position, key.header, key.footer options, possible. drawOpenKey may obviously used plots recommended draw.colorkey used wherever type additional scale labelling required.)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scale key handling for openair — drawOpenKey","text":"function modification lattice::draw.colorkey returns scale key using similar mechanism used original function developed Deepayan Sarkar.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Scale key handling for openair — drawOpenKey","text":"drawOpenKey function produces scale keys openair functions. drawOpenKey options identical lattice::draw.colorkey. example, scale key size position controlled via height, width space. Likewise, axis labelling can set formatted labels. See draw.colorkey details. Additional scale labelling may added scale using header footer options within key. openair functions, automatic text formatting can enabled via auto.key. (Note: Currently, formatting header footer text fixed style labels (scale axis) defined locally.) relationship header, footer scale key can controlled using fit options. can set key$fit apply uniform control individually key$header$fit /key$footer$fit control locally. appearance scale can controlled using plot.style.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Scale key handling for openair — drawOpenKey","text":"gratefully acknowledge considerable help advice Deepayan Sarkar.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Scale key handling for openair — drawOpenKey","text":"Deepayan Sarkar (2010). lattice: Lattice Graphics. R package version 0.18-5. http://r-forge.r-project.org/projects/lattice/","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Scale key handling for openair — drawOpenKey","text":"draw.colorkey part lattice package, developed Deepayan Sarkar. Additional modifications Karl Ropkins.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scale key handling for openair — drawOpenKey","text":"","code":"########## #example 1 ########## #paddle style scale key used by windRose windRose(mydata,) #adding text and changing style and position via key #note: #some simple key control also possible directly #For example, below does same as #windRose(mydata, key.position=\"right\") windRose(mydata, key =list(space=\"right\") ) #however: #more detailed control possible working with #key and drawOpenKey. For example, windRose(mydata, key = list(header=\"Title\", footer=\"wind speed\", plot.style = c(\"ticks\", \"border\"), fit = \"all\", height = 1, space = \"top\") )"},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":null,"dir":"Reference","previous_headings":"","what":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Function(s) import various ADMS file types openair. Currently handles \".met\", \".bgd\", \".mop\" \".pst\" file structures. Uses utils::read.csv() read data, format R openair apply file structure testing.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"","code":"importADMS( file = file.choose(), file.type = \"unknown\", drop.case = TRUE, drop.input.dates = TRUE, keep.units = TRUE, simplify.names = TRUE, test.file.structure = TRUE, drop.delim = TRUE, add.prefixes = TRUE, names = NULL, all = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"file ADMS file imported. Default, file.choose() opens browser. Use utils::read.csv() also allows readable text-mode connection url (although options currently fully tested). file.type Type ADMS file imported. default, \"unknown\", import uses file extension identify file type , recognised, uses identify file structure import method applied. file extension recognised choice may forced setting file.type one known file.type options: \"bgd\", \"met\", \"mop\" \"pst\". drop.case Option convert data names lower case. Default, TRUE. Alternative, FALSE, returns data name cases defined file. drop.input.dates Option remove ADMS \"hour\", \"day\", \"year\" data columns generating openair \"date\" timeseries. Default, TRUE. Alternative, FALSE, returns \"date\" associated ADMS data columns part openair data frame. keep.units Option retain ADMS data units. Default, TRUE, retains units (recoverable) character vector data frame comment defined file. Alternative, FALSE, discards units. (NOTE: currently, .bgd .pst files assign units. , option ignored importing .met .mop files.) simplify.names Option simplify data names accordance common openair practices. Default, TRUE. Alternative, FALSE, returns data names interpreted standard R. (NOTE: ADMS file data names include symbols structures R allow part name, renaming automatic regardless simplify.names setting. example, brackets symbols removed names replaced \".\", names form \"1/x\" may returned \"X1.x\" \"recip.x\".) test.file.structure Option test file structure trying import. Default, TRUE, tests expected file structure halts import operation found. Alternative, FALSE, attempts import regardless structure. drop.delim Option remove delim columns data frame. ADMS .mop files include two columns, \"INPUT_DATA:\" \"PROCESSED_DATA:\", separate model input output types. Default, TRUE, removes . Alternative, FALSE, retains part import. (Note: Option ignored importing .bgd, .met .pst files.) add.prefixes Option add prefixes data names. ADMS .mop files include number input process data types shared names. Prefixes can automatically added individual data can readily identified R/openair environment. Default, TRUE, adds \"process.\" prefix processed data. options include: FALSE uses prefixes leave name rationalisation R, character vectors treated required prefixes. one vector sent, treated processed data prefix. two () vectors sent, first second treated input processed data prefixes, respectively. example, argument (add.prefixes=\"\") add \"\" prefix processed data names, argument (add.prefixes=c(\"\",\"\")) add \"\" \"\" prefixes input output data names, respectively. (Note: Option ignored importing .bgd, .met .pst files.) names Option applied simplifyNamesADMS simplify.names enabled. names simplified default setting, NULL. .MOP files, return variables . = TRUE large number processed variables returned. ... Arguments passed utils::read.csv header logical value indicating whether file contains names variables first line. missing, value determined file format: header set TRUE first row contains one fewer field number columns. sep field separator character. Values line file separated character. sep = \"\" ( default read.table) separator ‘white space’, one spaces, tabs, newlines carriage returns. quote set quoting characters. disable quoting altogether, use quote = \"\". See scan behaviour quotes embedded quotes. Quoting considered columns read character, unless colClasses specified. dec character used file decimal points. fill logical. TRUE case rows unequal length, blank fields implicitly added. See ‘Details’. comment.char character: character vector length one containing single character empty string. Use \"\" turn interpretation comments altogether.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"standard use importADMS() returns data frame use openair. comparison original file, resulting data frame modified follows: Time date information combined single column \"date\", formatted conventional timeseries (.POSIX*). drop.input.dates enabled data series combined generated new \"date\" data series also removed. simplify.names enabled common chemical names may simplified, parameters may reset openair standards (e.g. \"ws\", \"wd\" \"temp\") according operations defined simplifyNamesADMS. summary simplification operations can obtained using, e.g., call importADMS(simplify.names). drop.case enabled upper case characters names converted lower case. keep.units enabled data units information may also retained part data frame comment available. .mop files, input processed data series names may also modified basis drop.delim add.prefixes settings","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"importADMS function developed help import various ADMS file types openair. cases parent import function work default configuration, e.g. mydata <- importADMS(). function currently recognises four file formats: .bgd, .met, .mop .pst. file extensions set file structure known, import call can forced , e.g, mydata <- importADMS(file.type=\"bgd\"). options can adjusted provide fine control data structuring renaming.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Times assumed GMT. Zero wind directions reset 360 part .mop file import.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Karl Ropkins, David Carslaw Matthew Williams (CERC).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"","code":"########## #example 1 ########## #To be confirmed #all current simplify.names operations importADMS(simplify.names) #> Simplification operation summary #> [ADMS => R => OPENAIR]: #> \t1/LMO => X1.LMO => RECIP.LMO #> \t1/MONIN-OBUKHOV LENGTH => X1.MONIN.OBUKHOV.LENGTH => RECIP.LMO #> \tALBEDO(D) => ALBEDO.D. => ALBEDO.DISP #> \tALBEDO (D) => ALBEDO..D. => ALBEDO.DISP #> \tALBEDO(DISP) => ALBEDO.DISP. => ALBEDO.DISP #> \tALBEDO (DISP) => ALBEDO..DISP. => ALBEDO.DISP #> \tALBEDO (DISPERSION AREA) => ALBEDO..DISPERSION.AREA. => ALBEDO.DISP #> \tALBEDO(M) => ALBEDO.M. => ALBEDO.MET #> \tALBEDO (M) => ALBEDO..M. => ALBEDO.MET #> \tALBEDO(MET) => ALBEDO.MET. => ALBEDO.MET #> \tALBEDO (MET) => ALBEDO..MET. => ALBEDO.MET #> \tALBEDO (MET SITE) => ALBEDO..MET.SITE. => ALBEDO.MET #> \tALPHA(D) => ALPHA.D. => ALPHA.DISP #> \tALPHA (D) => ALPHA..D. => ALPHA.DISP #> \tALPHA(DISP) => ALPHA.DISP. => ALPHA.DISP #> \tALPHA (DISP) => ALPHA..DISP. => ALPHA.DISP #> \tALPHA(M) => ALPHA.M. => ALPHA.MET #> \tALPHA (M) => ALPHA..M. => ALPHA.MET #> \tALPHA(MET) => ALPHA.MET. => ALPHA.MET #> \tALPHA (MET) => ALPHA..MET. => ALPHA.MET #> \tBL DEPTH => BL.DEPTH => H #> \tBOUNDARY LAYER DEPTH => BOUNDARY.LAYER.DEPTH => H #> \tBUOYANCY FREQUENCY ABOVE BOUNDARY LAYER => BUOYANCY.FREQUENCY.ABOVE.BOUNDARY.LAYER => NU #> \tCLOUD => CLOUD => CL #> \tCLOUD AMOUNT (OKTAS) => CLOUD.AMOUNT..OKTAS. => CL #> \tConc|ppb|NAME|SOURCES|-| RESOLUTION => Conc.ppb.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tConc|ppm|NAME|SOURCES|-| RESOLUTION => Conc.ppm.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tConc|ug/m3|NAME|SOURCES|-| RESOLUTION => Conc.ug.m3.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tNAME.All.sources.1hr => NAME.All.sources.1hr => NAME #> \tNAME.All.sources.RESOLUTION => NAME.All.sources.RESOLUTION => NAME.RESOLUTION #> \tNAME.SOURCE.1hr => NAME.SOURCE.1hr => NAME.SOURCE #> \tD(RELATIVE HUMIDITY)/DZ ABOVE BOUNDARY LAYER (PERCENT/M) => D.RELATIVE.HUMIDITY..DZ.ABOVE.BOUNDARY.LAYER..PERCENT.M. => DRHDZU #> \tDELTAPHI => DELTAPHI => DELTA.WD #> \tDELTAT => DELTAT => DELTA.T #> \tDELTA T => DELTA.T => DELTA.T #> \tDELTATHETA => DELTATHETA => DELTA.THETA #> \tDELTA THETA => DELTA.THETA => DELTA.THETA #> \tDIRN CHANGE => DIRN.CHANGE => DELTA.WD #> \tDRH/DZ => DRH.DZ => DRHDZU #> \tGEOSTROPHIC MINUS SURFACE WIND DIRECTION (DEGREES) => GEOSTROPHIC.MINUS.SURFACE.WIND.DIRECTION..DEGREES. => DELTA.WD #> \tHEAT FLUX => HEAT.FLUX => FTHETA0 #> \tINCOMING SOLAR RADIATION => INCOMING.SOLAR.RADIATION => K #> \tLATENT HEAT FLUX => LATENT.HEAT.FLUX => LAMBDAE #> \tLAT HT FLUX => LAT.HT.FLUX => LAMBDAE #> \tMODIFIED PRIESTLEY-TAYLOR PARAMETER (DISPERSION AREA) => MODIFIED.PRIESTLEY.TAYLOR.PARAMETER..DISPERSION.AREA. => ALPHA.DISP #> \tMODIFIED PRIESTLEY-TAYLOR PARAMETER (MET SITE) => MODIFIED.PRIESTLEY.TAYLOR.PARAMETER..MET.SITE. => ALPHA.MET #> \tN ABOVE BL => N.ABOVE.BL => NU #> \tPHI => PHI => WD #> \tPHI0 => PHI0 => WD.0 #> \tPHIG => PHIG => WD.G #> \tPHISEC => PHISEC => WD.SEC #> \tPRECIP => PRECIP => P #> \tPRECIPITATION RATE (MM/HOUR) => PRECIPITATION.RATE..MM.HOUR. => P #> \tR => R => ALBEDO.MET #> \tRECIPLMO => RECIPLMO => RECIP.LMO #> \tRELATIVE HUMIDITY ABOVE BOUNDARY LAYER (PERCENT) => RELATIVE.HUMIDITY.ABOVE.BOUNDARY.LAYER..PERCENT. => RHU #> \tRH ABOVE BL => RH.ABOVE.BL => RHU #> \tRHUM => RHUM => RHU #> \tROUGHNESS LENGTH (DISPERSION AREA) => ROUGHNESS.LENGTH..DISPERSION.AREA. => Z0.DISP #> \tROUGHNESS LENGTH (MET SITE) => ROUGHNESS.LENGTH..MET.SITE. => Z0.MET #> \tS HUMIDITY => S.HUMIDITY => SHU #> \tSEA SURFACE TEMPERATURE (C) => SEA.SURFACE.TEMPERATURE..C. => TSEA #> \tSEA TEMP => SEA.TEMP => TSEA #> \tSENSIBLE HEAT FLUX => SENSIBLE.HEAT.FLUX => FTHETA0 #> \tSIGMATHETA => SIGMATHETA => SIGMA.THETA #> \tSIGMA THETA => SIGMA.THETA => SIGMA.THETA #> \tSIGMA THETA (DEGREES) => SIGMA.THETA..DEGREES. => SIGMA.THETA #> \tSOLAR RAD => SOLAR.RAD => K #> \tSPECIFIC HUMIDITY => SPECIFIC.HUMIDITY => SHU #> \tT0C => T0C => TEMP #> \tTEMPERATURE => TEMPERATURE => TEMP #> \tTEMPERATURE (C) => TEMPERATURE..C. => TEMP #> \tTEMPERATURE JUMP ACROSS BOUNDARY LAYER TOP => TEMPERATURE.JUMP.ACROSS.BOUNDARY.LAYER.TOP => DELTA.THETA #> \tTEMPERATURE OVER LAND MINUS SEA SURFACE TEMPERATURE => TEMPERATURE.OVER.LAND.MINUS.SEA.SURFACE.TEMPERATURE => DELTA.T #> \tTime(s) => Time.s. => Time #> \tU => U => WS #> \tUG => UG => WS.G #> \tUGSTAR => UGSTAR => WS.GSTAR #> \tUSTAR => USTAR => WS.STAR #> \tWIND DIRN => WIND.DIRN => WD #> \tWIND DIRECTION (DEGREES) => WIND.DIRECTION..DEGREES. => WD #> \tWIND HEIGHT => WIND.HEIGHT => WIND.HEIGHT #> \tWIND MEASUREMENT HEIGHT => WIND.MEASUREMENT.HEIGHT => WIND.HEIGHT #> \tWIND SPEED => WIND.SPEED => WS #> \tX(m) => X.m. => X #> \tY(m) => Y.m. => Y #> \tZ(m) => Z.m. => Z #> \tZ0(D) => Z0.D. => Z0.DISP #> \tZ0 (D) => Z0..D. => Z0.DISP #> \tZ0(DISP) => Z0.DISP. => Z0.DISP #> \tZ0 (DISP) => Z0..DISP. => Z0.DISP #> \tZ0(M) => Z0.M. => Z0.MET #> \tZ0 (M) => Z0..M. => Z0.MET #> \tZ0(MET) => Z0.MET. => Z0.MET #> \tZ0 (MET) => Z0..MET. => Z0.MET #to see what simplify.names does to adms data series name PHI new.name <- importADMS(simplify.names, names=\"PHI\") new.name #> [1] \"WD\""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":null,"dir":"Reference","previous_headings":"","what":"Import air quality data from European database — importEurope","title":"Import air quality data from European database — importEurope","text":"function simplified version saqgetr package (see https://github.com/skgrange/saqgetr) accessing European air quality data. function returns valid hourly data meant fast convenient way accessing common type hourly air quality data. function works way openair functions import air quality data generally need site code year supplied.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import air quality data from European database — importEurope","text":"","code":"importEurope( site = \"debw118\", year = 2018, tz = \"UTC\", meta = FALSE, to_narrow = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import air quality data from European database — importEurope","text":"site code site(s). year Year years import. import sequence years 1990 2000 use year = 1990:2000. import several specific years use year = c(1990, 1995, 2000) example. tz used meta meta data returned? TRUE site type, latitude longitude returned. to_narrow default returned data column pollutant/variable. to_narrow = TRUE data stacked narrow format column identifying pollutant name. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import air quality data from European database — importEurope","text":"tibble","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import air quality data from European database — importEurope","text":"function can however return key site meta data. saqgetr package much comprehensive provides data time averages e.g. daily data.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import air quality data from European database — importEurope","text":"","code":"# import data for Stuttgart Am Neckartor (S) if (FALSE) { # \\dontrun{ stuttgart <- importEurope(\"debw118\", year = 2010:2019, meta = TRUE) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from King's College London networks — importKCL","title":"Import data from King's College London networks — importKCL","text":"Function importing hourly mean data King's College London networks. Files imported remote server operated King's College London provides air quality data files R data objects.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from King's College London networks — importKCL","text":"","code":"importKCL( site = \"my1\", year = 2009, pollutant = \"all\", met = FALSE, units = \"mass\", extra = FALSE, meta = FALSE, to_narrow = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from King's College London networks — importKCL","text":"site Site code network site import e.g. \"my1\" Marylebone Road. Several sites can imported site = c(\"my1\", \"kc1\") — import Marylebone Road North Kensignton example. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. met meteorological data added import data? default FALSE. TRUE wind speed (m/s), wind direction (degrees), solar radiation rain amount available. See details . units default returned data frame expresses units mass terms (ug/m3 NOx, NO2, O3, SO2; mg/m3 CO). Use units = \"volume\" use ppb etc. PM10_raw TEOM data multiplied 1.3 PM2.5 correction applied. See details concerning PM10 concentrations. extra currently used. meta Append site type, latitude longitude selected site? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import data from King's College London networks — importKCL","text":"Returns data frame hourly mean values date POSIXct class time zone GMT.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import data from King's College London networks — importKCL","text":"importKCL function written make easy import data King's College London air pollution networks. KCL provided .RData files (R workspaces) individual sites years KCL networks. files updated weekly basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. Finally, easy import many years data beyond current limit 64,000 lines. final point makes possible download several long time series one go. function also advantage proper site name imported used openair functions. site codes pollutant names can upper lower case. function issue warning data less six months old downloaded, may ratified. data imported stacking sites top one another field names date, site, code (site code) pollutant(s). Sometimes useful columns site data. can done using reshape function — see examples . situation particle measurements straightforward given variety methods used measure particle mass changes use time. importKCL function imports two measures PM10 available. PM10_raw TEOM measurements 1.3 factor applied take account volatile losses. PM10 data current best estimate gravimetric equivalent measure described . NOTE! many sites several instruments measure PM10 PM2.5. case FDMS measurements, given separate site codes (see ). example \"MY1\" TEOM VCM applied \"MY7\" FDMS data. FDMS data used volatile non-volatile components separately reported .e. v10 = volatile PM10, v2.5 = volatile PM2.5, nv10 = non-volatile PM10 nv2.5 = non-volatile PM2.5. Therefore, PM10 = v10 + nv10 PM2.5 = v2.5 + nv2.5. assessment EU Limit Values, PM10 needs measured using reference method one shown equivalent reference method. Defra carried extensive trials 2004 2006 establish types particulate analysers use UK equivalent. trials found measurements made using Partisol, FDMS, BAM SM200 instruments shown equivalent PM10 reference method. However, correction factors need applied measurements SM200 BAM instruments. Importantly, TEOM demonstrated equivalent reference method due loss volatile PM, even 1.3 correction factor applied. Volatile Correction Model (VCM) developed Defra King's allow measurements PM10 TEOM instruments converted reference equivalent; uses measurements volatile PM made using nearby FDMS instruments correct measurements made TEOM. passed equivalence testing using methodology used Defra trials now recommended method correcting TEOM measurements (Defra, 2009). VCM correction TEOM measurements can applied 1st January 2004, sufficiently widespread measurements volatile PM became available. 1.3 correction factor now considered redundant measurements PM10 made 1st January 2004. information VCM can found http://www.volatile-correction-model.info/. PM10 statistics LondonAir web site, including bulletins statistical tools (RData objects downloaded using importKCL), now report PM10 results reference equivalent. PM10 measurements made BAM SM200 analysers applicable correction factors applied. measurements TEOM analysers 1.3 factor applied 1st January 2004, VCM method used convert reference equivalent. meteorological data meant represent 'typical' conditions London, users may prefer use data. data provide estimate general meteorological conditions across Greater London. meteorological species (wd, ws, rain, solar) data point formed averaging measurements subset LAQN monitoring sites identified minimal disruption local obstacles long term reliable dataset. exact sites used varies species, include two five sites per species. Therefore, data represent 'London scale' meteorology, rather local conditions. function developed, following site codes help selection. also make available meta data site type location make easier select sites based information. Note codes need refined common species available export currently .e. NOx, NO2, O3, CO, SO2, PM10, PM2.5. A30 | Kingston - Kingston Bypass A3 | Roadside AD1 | Shoreham--Sea | Kerbside AR1 | Chichester - Lodsworth | Rural AR2 | Wealden - Isfield | Rural AS1 | Bath Aethalometer | Urban Background BA1 | Basildon - Gloucester Park | Roadside BB1 | Broxbourne (Roadside) | Roadside BE0 | Belfast - Carbon | Urban Background BE1 | Belfast Centre AURN | Urban Background BE3 | Belfast Centre Aethalometer | Urban Background BE7 | Belfast Centre FDMS trial | Urban Background BE8 | Belfast - Nitrate | Urban Background BE9 | Belfast - Partisol SO4 | Urban Background BF1 | Bedford Stewartby (Rural) | Industrial BF3 | Bedford - Kempston | Industrial BF4 | Bedford - Prebend Street | Roadside BF5 | Bedford - Lurke Street | Roadside BG1 | Barking Dagenham - Rush Green | Suburban BG2 | Barking Dagenham - Scrattons Farm | Suburban BG3 | Barking Dagenham - North Street | Kerbside BH0 | Brighton Preston Park AURN | Urban Background BH1 | Brighton Roadside | Roadside BH2 | Brighton Hove - Hove Town Hall | Roadside BH3 | Brighton Hove - Foredown Tower | Urban Background BH5 | Brighton Mobile (Preston Fire Station) | Roadside BH6 | Brighton Mobile (Lewes Road) | Roadside BH7 | Brighton Mobile (Gloucester Road) | Roadside BH8 | Brighton Hove - Stanmer Park | Rural BH9 | Brighton Mobile Beaconsfield Road | Roadside BI1 | Birmingham Tyburn CPC | Urban Background BL0 | Camden - Bloomsbury | Urban Background BL1 | Bloomsbury AURN SMPS | Urban Background BM1 | Ballymena - Ballykeel | Suburban BM2 | Ballymena - North Road | Roadside BN1 | Barnet - Tally Ho Corner | Kerbside BN2 | Barnet Finchley | Urban Background BN3 | Barnet - Strawberry Vale | Urban Background BO1 | Ballymoney 1 | Suburban BP0 | Westminster - Bridge Place | Urban Background BQ5 | Bexley - Manor Road West Gravimetric | Industrial BQ6 | Bexley - Manor Road East Gravimetric | Industrial BQ7 | Belvedere West | Urban Background BQ8 | Belvedere West FDMS | Urban Background BT1 | Brent - Kingsbury | Suburban BT2 | Brent - Ikea Car Park | Roadside BT3 | Brent - Harlesden | Roadside BT4 | Brent - Ikea | Roadside BT5 | Brent - Neasden Lane | Industrial BT6 | Brent - John Keble Primary School | Roadside BT7 | Brent - St Marys Primary School | Urban Background BW1 | Brentwood - Brentwood Town Hall | Urban Background BX0 | Bexley - Belvedere FDMS | Suburban BX1 | Bexley - Slade Green | Suburban BX2 | Bexley - Belvedere | Suburban BX3 | Bexley - Thamesmead | Suburban BX4 | Bexley - Erith | Industrial BX5 | Bexley - Bedonwell | Suburban BX6 | Bexley - Thames Road North FDMS | Roadside BX7 | Bexley - Thames Road North | Roadside BX8 | Bexley - Thames Road South | Roadside BX9 | Bexley - Slade Green FDMS | Suburban BY1 | Bromley - Rent Office | Urban Background BY4 | Bromley - Tweedy Rd | Roadside BY5 | Bromley - Biggin Hill | Suburban BY7 | Bromley - Harwood Avenue | Roadside CA1 | Crawley Background | Urban Background CA2 | Crawley - Gatwick Airport | Urban Background CB1 | Chelmsford - Fire Station | Roadside CB2 | Chelmsford - Springfield Road | Roadside CB3 | Chelmsford - Chignal St James | Urban Background CB4 | Chelmsford - Baddow Road | Roadside CC1 | Colchester - Lucy Lane South | Roadside CC2 | Colchester - Brook Street | Roadside CC3 | Colchester - Mersea Road | Roadside CD1 | Camden - Swiss Cottage | Kerbside CD3 | Camden - Shaftesbury Avenue | Roadside CD4 | Camden - St Martins College (NOX | Urban Background CD5 | Camden - St Martins College (NOX 2) | Urban Background CD7 | Camden - Swiss Cottage Partisol | Kerbside CD9 | Camden - Euston Road | Roadside CF1 | Cardiff Aethalometer | Urban Background CH1 | Cheltenham | Urban Background CI1 | Chichester - A27 Chichester Bypass | Roadside CI4 | Chichester - Orchard Street | Roadside CK1 | Cookstown | Suburban CP1 | Castle Point - Canvey Island | Urban Background CR2 | Croydon - Purley Way | Roadside CR3 | Croydon - Thornton Heath | Suburban CR4 | Croydon - George Street | Roadside CR5 | Croydon - Norbury | Kerbside CR6 | Croydon - Euston Road | Suburban CT1 | City London - Senator House | Urban Background CT2 | City London - Farringdon Street | Kerbside CT3 | City London - Sir John Cass School | Urban Background CT4 | City London - Beech Street | Roadside CT6 | City London - Walbrook Wharf | Roadside CT8 | City London - Upper Thames Street | Roadside CY1 | Crystal Palace - Crystal Palace Parade | Roadside DC1 | Dacorum 1 Hemel Hempstead (Background) | Urban Background DC2 | Dacorum 2 Hemel Hempstead (Background) | Urban Background DC3 | High Street Northchurch | Roadside DE1 | Derry City - Brandywell | Urban Background DE2 | Derry City - Dales Corner | Roadside DM1 | Dunmurry Aethalometer | Urban Background EA0 | Ealing - Acton Town Hall FDMS | Roadside EA1 | Ealing - Ealing Town Hall | Urban Background EA2 | Ealing - Acton Town Hall | Roadside EA3 | Ealing 3 - A40 East Acton | Roadside EA4 | Ealing Mobile - Hamilton Road | Roadside EA5 | Ealing Mobile - Southall | Roadside EA6 | Ealing - Hanger Lane Gyratory | Roadside EA7 | Ealing - Southall | Urban Background EA8 | Ealing - Horn Lane | Industrial EA9 | Ealing - Court Way | Roadside EB1 | Eastbourne - Devonshire Park | Urban Background EB3 | Eastbourne - Holly Place | Urban Background EH1 | E Herts Throcking (Rural) | Rural EH2 | East Herts Sawbridgeworth (Background) | Urban Background EH3 | East Herts Sawbridgeworth (Roadside) | Roadside EH4 | East Herts Ware | Roadside EH5 | East Herts Bishops Stortford | Roadside EI0 | Ealing - Greenford | Urban Background EI1 | Ealing - Western Avenue | Roadside EL1 | Elmbridge - Bell Farm Hersham | Urban Background EL2 | Elmbridge - Esher High Street | Roadside EL3 | Elmbridge - Hampton Court Parade | Roadside EL4 | Elmbridge - Walton High Street | Kerbside EN1 | Enfield - Bushhill Park | Suburban EN2 | Enfield Church Street | Roadside EN3 | Enfield - Salisbury School | Urban Background EN4 | Enfield - Derby Road | Roadside EN5 | Enfield - Bowes Primary School | Roadside FB1 | Rushmoor - Medway Drive | Roadside GB0 | Greenwich Bexley - Falconwood FDMS | Roadside GB6 | Greenwich Bexley - Falconwood | Roadside GL1 | Glasgow Centre | Suburban GL4 | Glasgow Centre Aethalometer | Suburban GN0 | Greenwich - A206 Burrage Grove | Roadside GN2 | Greenwich - Millennium Village | Industrial GN3 | Greenwich - Plumstead High Street | Roadside GN4 | Greenwich - Fiveways Sidcup Rd A20 | Roadside GR4 | Greenwich - Eltham | Suburban GR5 | Greenwich - Trafalgar Road | Roadside GR7 | Greenwich - Blackheath | Roadside GR8 | Greenwich - Woolwich Flyover | Roadside GR9 | Greenwich - Westhorne Avenue | Roadside HA0 | Harwell - Carbon | Rural HA1 | Harwell Rural AURN | Rural HA2 | Harwell Rural PARTISOL | Rural HA4 | Harwell Rural SMPS | Rural HA9 | Harwell - Partisol SO4 | Urban Background HF1 | Hammersmith Fulham - Broadway | Roadside HF2 | Hammersmith Fulham - Brook Green | Urban Background HF3 | Hammersmith Fulham - Scrubs Lane | Kerbside HG1 | Haringey - Haringey Town Hall | Roadside HG2 | Haringey - Priory Park | Urban Background HG3 | Haringey - Bounds Green | Roadside HI0 | Hillingdon - Sipson Road | Suburban HI1 | Hillingdon - South Ruislip | Roadside HI2 | Hillingdon - Hillingdon Hospital | Roadside HI3 | Hillingdon - Oxford Avenue | Roadside HK4 | Hackney - Clapton | Urban Background HK6 | Hackney - Old Street | Roadside HL1 | Halifax Aethalometer | Urban Background HM1 | Hertsmere Borehamwood 1 (Background) | Urban Background HM4 | Hertsmere - Borehamwood | Urban Background HO1 | Horsham Background | Urban Background HO2 | Horsham - Park Way | Roadside HO4 | Horsham - Storrington | Roadside HO5 | Horsham - Cowfold | Roadside HR1 | Harrow - Stanmore | Urban Background HR2 | Harrow - Pinner Road | Roadside HS1 | Hounslow - Brentford | Roadside HS2 | Hounslow - Cranford | Suburban HS3 | Hounslow - Brentford | Roadside HS4 | Hounslow - Chiswick High Road | Roadside HS5 | Hounslow - Brentford | Roadside HS6 | Hounslow - Heston Road | Roadside HS7 | Hounslow - Hatton Cross | Urban Background HS9 | Hounslow - Feltham | Roadside HT1 | Hastings - Bulverhythe | Roadside HT2 | Hastings - Fresh Fields | Roadside HV1 | Havering - Rainham | Roadside HV2 | Havering - Harold Hill | Suburban HV3 | Havering - Romford | Roadside HX0 | Birmingham Tyburn Aethalometer | Urban Background IC6 | City London Walbrook Wharf Indoor | Roadside IG4 | Greenwich - Eltham Ecology Centre Indoor | Urban Background IS1 | Islington - Upper Street | Urban Background IS2 | Islington - Holloway Road | Roadside IS4 | Islington - Foxham Gardens | Urban Background IS5 | Islington - Duncan Terrace | Roadside IS6 | Islington - Arsenal | Urban Background IT2 | Tower Hamlets - Mile End Road | Roadside KB1 | South Kirkby Aethalometer | Urban Background KC0 | North Kensington - Carbon | Urban Background KC1 | Kensington Chelsea - North Ken | Urban Background KC2 | Kensington Chelsea - Cromwell Road | Roadside KC3 | Kensington Chelsea - Knightsbridge | Roadside KC4 | Kensington Chelsea - Kings Road | Roadside KC5 | Kensington Chelsea - Earls Court Rd | Kerbside KC7 | Kensington Chelsea - North Ken FDMS | Urban Background KC9 | North Kensington - Partisol SO4 | Urban Background KT1 | Kingston - Chessington | Suburban KT2 | Kingston - Town Centre | Roadside LA1 | Luton Airport | Urban Background LB1 | Lambeth - Christchurch Road | Roadside LB2 | Lambeth - Vauxhall Cross | Roadside LB3 | Lambeth - Loughborough Junct | Urban Background LB4 | Lambeth - Brixton Road | Kerbside LB5 | Lambeth - Bondway Interchange | Roadside LB6 | Lambeth - Streatham Green | Urban Background LH0 | Hillingdon - Harlington | Urban Background LH2 | Heathrow Airport | Urban Background LL1 | Lullington Heath Rural AURN | Rural LN1 | Luton - Challney Community College | Urban Background LS1 | Lewes - Telscombe Cliffs | Roadside LS2 | Lewes - Commercial Square | Roadside LS4 | Newhaven - Denton School | Urban Background LW1 | Lewisham - Catford | Urban Background LW2 | Lewisham - New Cross | Roadside LW3 | Lewisham Mercury Way | Industrial MA1 | Manchester Piccadilly CPC | Urban Background MA2 | Manchester Piccadilly | Urban Background MD1 | Mid Beds Biggleswade (Roadside) | Roadside MD2 | Mid Beds Silsoe (Rural) | Rural MD3 | Central Beds - Sandy | Roadside MD4 | Central Beds - Marston Vale | Rural ME1 | Merton - Morden Civic Centre | Roadside MP1 | Marchwood Power - Marchwood | Industrial MP2 | Marchwood Power - Millbrook Rd Soton | Industrial MR3 | Marylebone Road Aethalometer | Kerbside MV1 | Mole Valley - Leatherhead | Rural MV2 | Mole Valley - Lower Ashtead | Suburban MV3 | Mole Valley - Dorking | Urban Background MW1 | Windsor Maidenhead - Frascati Way | Roadside MW2 | Windsor Maidenhead - Clarence Road | Roadside MW3 | Windsor Maidenhead - Ascot | Rural MY0 | Marylebone Road - Carbon | Kerbside MY1 | Westminster - Marylebone Road | Kerbside MY7 | Westminster - Marylebone Road FDMS | Kerbside NA5 | Newtownabbey- Mallusk | Urban Background NA6 | Newtownabbey- Shore Road | Roadside NE2 | Port Talbot TEOM CPC | Urban Background NF1 | New Forest - Holbury | Industrial NF2 | New Forest - Fawley | Industrial NF3 | New Forest - Ringwood | Urban Background NF4 | New Forest - Totton | Roadside NF5 | New Forest - Lyndhurst | Roadside NH1 | North Herts Mobile - Baldock 1 | Roadside NH2 | North Herts Mobile - Baldock 2 | Roadside NH3 | North Herts Mobile - Royston | Urban Background NH4 | North Herts - Breechwood Green | Urban Background NH5 | North Herts - Baldock Roadside | Roadside NH6 | North Herts - Hitchin Library | Roadside NK1 | North Kensington - CPC | Urban Background NK3 | North Kensington Aethalometer | Urban Background NK6 | North Kensington - URG | Urban Background NM1 | Newham - Tant Avenue | Urban Background NM2 | Newham - Cam Road | Roadside NM3 | Newham - Wren Close | Urban Background NW1 | Norwich Centre Aethalometer | Urban Background OX0 | Oxford Centre Roadside AURN | Urban Background OX1 | South Oxfordshire - Henley | Roadside OX2 | South Oxfordshire - Wallingford | Roadside OX3 | South Oxfordshire - Watlington | Roadside OX4 | Oxford St Ebbes AURN | Urban Background PO1 | Portsmouth Background AURN | Urban Background PT6 | Port Talbot Dyffryn School | Industrial RB1 | Redbridge - Perth Terrace | Urban Background RB2 | Redbridge - Ilford Broadway | Kerbside RB3 | Redbridge - Fullwell Cross | Kerbside RB4 | Redbridge - Gardner Close | Roadside RB5 | Redbridge - South Woodford | Roadside RD0 | Reading AURN - New Town | Urban Background RD1 | Reading - Caversham Road | Roadside RD2 | Reading - Kings Road | Roadside RD3 | Reading - Oxford Road | Roadside RG1 | Reigate Banstead - Horley | Suburban RG2 | Reigate Banstead - Horley South | Suburban RG3 | Reigate Banstead - Poles Lane | Rural RG4 | Reigate Banstead - Reigate High St | Kerbside RHA | Richmond - Lower Mortlake Road | Roadside RHB | Richmond - Lower Mortlake Road | Roadside RI1 | Richmond - Castelnau | Roadside RI2 | Richmond - Barnes Wetlands | Suburban RI5 | Richmond Mobile - St Margarets | Kerbside RI6 | Richmond Mobile St Margarets | Kerbside RI7 | Richmond Mobile - Richmond Park | Suburban RI8 | Richmond Mobile - Richmond Park | Suburban RIA | Richmond Mobile - George Street | Kerbside RIB | Richmond Mobile - George Street | Kerbside RIC | Richmond Mobile - Kew Rd | Kerbside RID | Richmond Mobile - Kew Rd | Kerbside RIE | Richmond Mobile Richmond Rd Twickenham | Roadside RIF | Richmond Mobile - Richmond Rd Twickenham | Roadside RIG | Richmond Mobile - Upper Teddington Rd | Roadside RIH | Richmond Mobile - Upper Teddington Rd | Roadside RII | Richmond Mobile - Somerset Rd Teddington | Urban Background RIJ | Richmond Mobile - Somerset Rd Teddington | Urban Background RIK | Richmond Mobile - St. Margarets Grove | Urban Background RIL | Richmond Mobile - St. Margarets Grove | Urban Background RIM | Richmond Mobile - Petersham Rd Ham | Roadside RIN | Richmond Mobile - Petersham Rd Ham | Roadside RIO | Richmond Mobile - Stanley Rd Twickenham | Roadside RIP | Richmond Mobile - Stanley Rd Twickenham | Roadside RIQ | Richmond Mobile - Richmond Rd Twickenham | Roadside RIR | Richmond Mobile - Richmond Rd Twickenham | Roadside RIS | Richmond Mobile - Lincoln Ave Twickenham | Roadside RIU | Richmond Mobile - Mortlake Rd Kew | Roadside RIW | Richmond - Upper Teddington Road | Roadside RIY | Richmond - Hampton Court Road | Kerbside RO1 | Rochford - Rayleigh High Street | Roadside RY1 | Rother - Rye Harbour | Rural RY2 | Rother - De La Warr Road | Roadside SA1 | St Albans - Fleetville | Urban Background SB1 | South Beds - Dunstable | Urban Background SC1 | Sevenoaks 1 | Suburban SD1 | Southend--Sea AURN | Urban Background SE1 | Stevenage - Lytton Way | Roadside SH1 | Southampton Background AURN | Urban Background SH2 | Southampton - Redbridge | Roadside SH3 | Southampton - Onslow Road | Roadside SH4 | Southampton - Bitterne | Urban Background SK1 | Southwark - Larcom Street | Urban Background SK2 | Southwark - Old Kent Road | Roadside SK5 | Southwark - A2 Old Kent Road | Roadside SL1 | Sunderland Aethalometer | Urban Background ST1 | Sutton - Robin Hood School | Roadside ST2 | Sutton - North Cheam | Urban Background ST3 | Sutton - Carshalton | Suburban ST4 | Sutton - Wallington | Kerbside ST5 | Sutton - Beddington Lane | Industrial ST6 | Sutton - Worcester Park | Kerbside ST7 | Sutton - Therapia Lane | Industrial SU1 | Sussex Mobile10 Stockbridge | Kerbside SU2 | Sussex Mobile11 Jct Whitley Rd | Kerbside SU3 | Sussex Mobile12 Cowfold | Kerbside SU4 | Sussex Mobile 13 Newhaven | Roadside SU5 | Sussex Mobile 14 Crawley | Roadside SU6 | Sussex Mobile15 Chichester County Hall | Urban Background SU7 | Sussex Mobile 16 Warnham | Rural SU8 | Sussex Mobile 17 Newhaven Paradise Park | Roadside SX1 | Sussex Mobile 1 | Urban Background SX2 | Sussex Mobile 2 North Berstead | Roadside SX3 | Sussex Mobile 3 | Roadside SX4 | Sussex Mobile 4 Adur | Roadside SX5 | Sussex Mobile 5 Fresh Fields Rd Hastings | Roadside SX6 | Sussex Mobile 6 Orchard St Chichester | Roadside SX7 | Sussex Mobile 7 New Road Newhaven | Roadside SX8 | Sussex Mobile 8 Arundel | Kerbside SX9 | Sussex Mobile 9 Newhaven Kerbside | Kerbside TD0 | Richmond - National Physical Laboratory | Suburban TE0 | Tendring St Osyth AURN | Rural TE1 | Tendring - Town Hall | Roadside TH1 | Tower Hamlets - Poplar | Urban Background TH2 | Tower Hamlets - Mile End Road | Roadside TH3 | Tower Hamlets - Bethnal Green | Urban Background TH4 | Tower Hamlets - Blackwall | Roadside TK1 | Thurrock - London Road (Grays) | Urban Background TK2 | Thurrock - Purfleet | Roadside TK3 | Thurrock - Stanford-le-Hope | Roadside TK8 | Thurrock - London Road (Purfleet) | Roadside TR1 | Three Rivers - Rickmansworth | Urban Background UT1 | Uttlesford - Saffron Walden Fire Station | Roadside UT2 | Uttlesford - Takeley | Urban Background UT3 | Uttlesford - Broxted Farm | Rural VS1 | Westminster - Victoria Street | Kerbside WA1 | Wandsworth - Garratt Lane | Roadside WA2 | Wandsworth - Town Hall | Urban Background WA3 | Wandsworth - Roehampton | Rural WA4 | Wandsworth - High Street | Roadside WA6 | Wandsworth - Tooting | Roadside WA7 | Wandsworth - Putney High Street | Kerbside WA8 | Wandsworth - Putney High Street Facade | Roadside WA9 | Wandsworth - Putney | Urban Background WE0 | Kensington Chelsea - Pembroke Road | Urban Background WF1 | Watford (Roadside) | Roadside WF2 | Watford - Watford Town Hall | Roadside WH1 | Welwyn Hatfield - Council Offices | Urban Background WL1 | Waltham Forest - Dawlish Road | Urban Background WL2 | Waltham Forest - Mobile | Roadside WL3 | Waltham Forest - Chingford | Roadside WL4 | Waltham Forest - Crooked Billet | Kerbside WL5 | Waltham Forest - Leyton | Roadside WM0 | Westminster - Horseferry Road | Urban Background WM3 | Westminster - Hyde Park Partisol | Roadside WM4 | Westminster - Charing Cross Library | Roadside WM5 | Westminster - Covent Garden | Urban Background WM6 | Westminster - Oxford St | Kerbside WR1 | Bradford Town Hall Aethalometer | Urban Background WT1 | Worthing - Grove Lodge | Kerbside XB1 | Bletchley | Rural XS1 | Shukri Outdoor | Industrial XS2 | Shukri Indoor | Industrial XS3 | Osiris mobile | Urban Background YH1 | Harrogate Roadside | Roadside ZA1 | Ashford Rural - Pluckley | Rural ZA2 | Ashford Roadside | Roadside ZA3 | Ashford Background | Urban Background ZA4 | Ashford M20 Background | Urban Background ZC1 | Chatham Roadside - A2 | Roadside ZD1 | Dover Roadside - Town Hall | Roadside ZD2 | Dover Roadside - Townwall Street | Roadside ZD3 | Dover Background - Langdon Cliff | Urban Background ZD4 | Dover Background - East Cliff | Urban Background ZD5 | Dover Coast Guard Met | Urban Background ZD6 | Dover Docks | Industrial ZF1 | Folkestone Suburban - Cheriton | Suburban ZG1 | Gravesham Backgrnd - Northfleet | Urban Background ZG2 | Gravesham Roadside - A2 | Roadside ZG3 | Gravesham Ind Bgd - Northfleet | Urban Background ZH1 | Thanet Rural - Minster | Rural ZH2 | Thanet Background - Margate | Urban Background ZH3 | Thanet Airport - Manston | Urban Background ZH4 | Thanet Roadside - Ramsgate | Roadside ZL1 | Luton Background | Urban Background ZM1 | Maidstone Meteorological | Urban Background ZM2 | Maidstone Roadside - Fairmeadow | Kerbside ZM3 | Maidstone Rural - Detling | Rural ZR1 | Dartford Roadside - St Clements | Kerbside ZR2 | Dartford Roadside 2 - Town Centre | Roadside ZR3 | Dartford Roadside 3 - Bean Interchange | Roadside ZS1 | Stoke Rural AURN | Rural ZT1 | Tonbridge Roadside - Town Centre | Roadside ZT2 | Tunbridge Wells Background - Town Hall | Urban Background ZT3 | Tunbridge Wells Rural - Southborough | Rural ZT4 | Tunbridge Wells Roadside - St Johns | Roadside ZT5 | Tonbridge Roadside 2 - High St | Roadside ZV1 | Sevenoaks - Greatness Park | Urban Background ZV2 | Sevenoaks - Bat Ball | Roadside ZW1 | Swale Roadside - Ospringe A2 | Roadside ZW2 | Swale Background - Sheerness | Urban Background ZW3 | Swale Roadside 2 - Ospringe Street | Roadside ZY1 | Canterbury Backgrnd - Chaucer TS | Urban Background ZY2 | Canterbury Roadside - St Dunstans | Roadside ZY4 | Canterbury St Peters Place | Roadside","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import data from King's College London networks — importKCL","text":"David Carslaw Ben Barratt","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import data from King's College London networks — importKCL","text":"","code":"## import all pollutants from Marylebone Rd from 1990:2009 if (FALSE) mary <- importKCL(site = \"my1\", year = 2000:2009) # \\dontrun{} ## import nox, no2, o3 from Marylebone Road and North Kensignton for 2000 if (FALSE) thedata <- importKCL(site = c(\"my1\", \"kc1\"), year = 2000, pollutant = c(\"nox\", \"no2\", \"o3\")) # \\dontrun{} ## import met data too... if (FALSE) my1 <- importKCL(site = \"my1\", year = 2008, met = TRUE) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":null,"dir":"Reference","previous_headings":"","what":"Import monitoring site meta data for UK and European networks — importMeta","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"Function import meta data air quality monitoring sites. default, function return site latitude, longitude site type, well code used functions like importUKAQ(), importKCL() importEurope(). Additional information may optionally returned.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"","code":"importMeta(source = \"aurn\", all = FALSE, year = NA, duplicate = FALSE)"},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"source One air quality networks data available openair. Available networks include: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. \"kcl\", King's College London networks. \"europe\", European AirBase/e-reporting data. two additional options provided convenience: \"ukaq\" return metadata networks data imported importUKAQ() (.e., AURN, AQE, SAQN, WAQN, NI, local networks). \"\" import available metadata (.e., \"ukaq\" plus \"kcl\" \"europe\"). = FALSE site code, site name, latitude longitude site type imported. Setting = TRUE import available meta data provide details (available) individual pollutants measured site. year single year selected, sites open point year returned. = TRUE sites measured particular pollutant year returned. Year can also sequence e.g. year = 2010:2020 length 2 e.g. year = c(2010, 2020), return sites open duration. Note year ignored source either \"kcl\" \"europe\". duplicate UK air quality sites part multiple networks, appear source vector two . default argument, FALSE, drops duplicate sites. TRUE return .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"data frame meta data.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"function imports site meta data several networks UK Europe: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. \"kcl\", King's College London networks. \"europe\", Hourly European data (Air Quality e-Reporting) based simplified version {saqgetr} package. default, function return site latitude, longitude site type. option = TRUE used, much detailed information returned. networks, detailed information includes per-pollutant summaries, opening closing dates sites etc. Thanks go Trevor Davies (Ricardo), Dr Stuart Grange (EMPA) Dr Ben Barratt (KCL) making data available.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"","code":"if (FALSE) { # \\dontrun{ # basic info: meta <- importMeta(source = \"aurn\") # more detailed information: meta <- importMeta(source = \"aurn\", all = TRUE) # from the Scottish Air Quality Network: meta <- importMeta(source = \"saqn\", all = TRUE) # from multiple networks: meta <- importMeta(source = c(\"aurn\", \"aqe\", \"local\")) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":null,"dir":"Reference","previous_headings":"","what":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"Function import pre-calculated back trajectories using NOAA HYSPLIT model. trajectories calculated select range locations expand time. cover last 20 years can used together openair functions.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"","code":"importTraj(site = \"london\", year = 2009, local = NA, progress = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"site Site code network site import e.g. \"london\". one site can imported time. following sites typically available 2000-2012, although UK ozone sites go back 1988 (code, location, lat, lon, year): year Year years import. import sequence years 1990 2000 use year = 1990:2000. import several specific years use year = c(1990, 1995, 2000) example. local File path .RData trajectory files run user stored Ricardo web server. files generated Hysplit trajectory code shown appendix openair manual. example local = 'c:/users/david/TrajFiles/'. progress Show progress bar many receptors/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"Returns data frame pre-calculated back trajectories.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"function imports pre-calculated back trajectories using HYSPLIT trajectory model (Hybrid Single Particle Lagrangian Integrated Trajectory Model. Back trajectories provide useful information air quality data analysis. However, commonly calculated researchers generally difficult calculated routine basis used easily. addition, availability back trajectories several years can useful, difficult calculate. Trajectories run 3-hour intervals stored yearly files (see ). trajectories started ground-level (10m) propagated backwards time. trajectories calculated using Global NOAA-NCEP/NCAR reanalysis data archives. global data latitude-longitude grid (2.5 degree). Note many different meteorological data sets can used run HYSPLIT e.g. including ECMWF data. However, order make practicable run store trajectories many years sites, NOAA-NCEP/NCAR reanalysis data useful. addition, archives available use widely, case many data sets e.g. ECMWF. HYSPLIT calculated trajectories based archive data may distributed without permission. wanting, example, consider higher resolution meteorological data sets may better run trajectories separately. extremely grateful NOAA making HYSPLIT available produce back trajectories open way. ask cite HYSPLIT used published work. Users can supply trajectory files plot openair. files must following fields: date, lat, lon hour.inc (see details ). files consist following information: date arrival point time repeated number times equal length back trajectory — typically 96 hours (except early file). format POSIXct. field used link air quality data. See example . receptor Receptor number, currently 1. year year month Month 1-12 day Day month 1-31 hour Hour day 0-23 GMT hour.inc Number hours back time e.g. 0 -96. lat Latitude decimal format. lon Longitude decimal format. height Height trajectory (m). pressure Pressure trajectory (kPa).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"trajectories run using February 2011 HYSPLIT model. function primarily written investigate single site time single year. trajectory files quite large care exercised importing several years /sites.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"","code":"## import trajectory data for London in 2009 if (FALSE) mytraj <- importTraj(site = \"london\", year = 2009) # \\dontrun{} ## combine with measurements if (FALSE) theData <- importAURN(site = \"kc1\", year = 2009) mytraj <- merge(mytraj, theData, by = \"date\") # \\dontrun{} #> Error: object 'mytraj' not found"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from individual UK Air Pollution Networks — importAURN","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"functions act wrappers importUKAQ() import air pollution data range UK networks including Automatic Urban Rural Network (AURN), individual England (AQE), Scotland (SAQN), Wales (WAQN) Northern Ireland (NI) Networks, many \"locally managed\" monitoring networks across England. importUKAQ() allows data imported flexibly, including across multiple monitoring networks, functions provided convenience back-compatibility.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"","code":"importAURN( site = \"my1\", year = 2009, data_type = \"hourly\", pollutant = \"all\", hc = FALSE, meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importAQE( site = \"yk13\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importSAQN( site = \"gla4\", year = 2009, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importWAQN( site = \"card\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importNI( site = \"bel0\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importLocal( site = \"ad1\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"site Site code site import, e.g., \"my1\" Marylebone Road. Site codes can discovered use importMeta(). Several sites can imported . example, site = c(\"my1\", \"nott\") imports Marylebone Road Nottingham. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). data_type type data returned, defaulting \"hourly\" data. Alternative data types include: \"daily\": Daily average data. \"monthly\": Monthly average data data capture information whole network. \"annual\": Annual average data data capture information whole network. \"15_min\": 15-minute average SO2 concentrations. \"8_hour\": 8-hour rolling mean concentrations O3 CO. \"24_hour\": 24-hour rolling mean concentrations particulates. \"daily_max_8\": Maximum daily rolling 8-hour maximum O3 CO. \"daqi\": Daily Air Quality Index (DAQI). See details index defined. Note data_type available locally managed monitoring networks. pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. hc Include hydrocarbon measurements imported data? Defaults FALSE users interested using hydrocarbon data. meta Append site type, latitude longitude selected site? Defaults FALSE. meteo Append modelled meteorological data, available? Defaults TRUE, return wind speed (ws), wind direction (wd) ambient temperature (air_temp). variables calculated using WRF model run Ricardo Energy & Environment available networks. Setting meteo = FALSE useful meteorological data use preference, example worldmet package. ratified Append qc column(s) hourly data indicating whether species ratified (.e., quality-checked)? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. verbose Print messages console hourly data imported? Default FALSE. TRUE useful debugging specific year(s), site(s) source(s) imported returned. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"importing-uk-air-pollution-data","dir":"Reference","previous_headings":"","what":"Importing UK Air Pollution Data","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"family functions written make easy import data across several UK air quality networks. Ricardo provided .RData files (R workspaces) individual sites years, well date meta data. files updated daily basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. function also advantage proper site name imported used openair functions. Users take care using data openair web portals (example, UK AIR). One key difference data provided openair date beginning, whereas web portal provides date ending. Hourly concentrations may therefore appear offset hour, example. data imported stacking sites top one another field names site, code (site code) pollutant. default, function returns hourly average data. However, annual, monthly, daily 15 minute data (SO2) can returned using option data_type. Annual monthly data provide whole network information including data capture statistics. units expressed mass terms gaseous species (ug/m3 , NO2, NOx (NO2), SO2 hydrocarbons; mg/m3 CO). PM10 concentrations provided gravimetric units ug/m3 scaled comparable units. years variety instruments used measure particulate matter technical issues measuring PM10 complex. recent years measurements rely FDMS (Filter Dynamics Measurement System), able measure volatile component PM. cases FDMS system use separate volatile component recorded 'v10' non-volatile component 'nv10', already included absolute PM10 measurement. Prior use FDMS measurements used TEOM (Tapered Element Oscillating. Microbalance) concentrations multiplied 1.3 provide estimate total mass including volatile fraction. sites report hourly daily PM10 / PM2.5. data_type = \"daily\" hourly 'proper' daily measurements available, returned e.g. \"pm2.5\" \"gr_pm2.5\"; former corresponding data based original hourly measurements latter corresponding daily gravimetric measurements. function returns modelled hourly values wind speed (ws), wind direction (wd) ambient temperature (air_temp) available (generally around 2010). values modelled using WRF model operated Ricardo. BAM (Beta-Attenuation Monitor) instruments incorporated network throughout history scaled 1.3 heated inlet (account loss volatile particles) 0.83 heated inlet. TEOM instruments network 2008 scaled using VCM (Volatile Correction Model) values account loss volatile particles. object scaling processes provide reasonable degree comparison data sets reference method produce consistent data record operational period network, however may discontinuity time series associated instrument changes. corrections made PM2.5 data. volatile component FDMS PM2.5 (available) shown 'v2.5' column.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from the UK Air Pollution Networks — importUKAQ","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"Functions importing air pollution data range UK networks including Automatic Urban Rural Network (AURN), individual England (AQE), Scotland (SAQN), Wales (WAQN) Northern Ireland (NI) Networks, many \"locally managed\" monitoring networks across England. Files imported remote server operated Ricardo provides air quality data files R data objects. date list available sites can imported, see importMeta().","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"","code":"importUKAQ( site = \"my1\", year = 2022, source = \"aurn\", data_type = \"hourly\", pollutant = \"all\", hc = FALSE, meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"site Site code site import, e.g., \"my1\" Marylebone Road. Site codes can discovered use importMeta(). Several sites can imported . example, site = c(\"my1\", \"nott\") imports Marylebone Road Nottingham. Sites different networks can imported also providing multiple sources. Site codes can upper lower case. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). source network site(s) belong, defaulting \"aurn\". Providing single network attempt import given sites provided network. Alternatively, vector sources can provided length site indicate network site individually belongs. Available networks include: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. data_type type data returned, defaulting \"hourly\" data. Alternative data types include: \"daily\": Daily average data. \"monthly\": Monthly average data data capture information whole network. \"annual\": Annual average data data capture information whole network. \"15_min\": 15-minute average SO2 concentrations. \"8_hour\": 8-hour rolling mean concentrations O3 CO. \"24_hour\": 24-hour rolling mean concentrations particulates. \"daily_max_8\": Maximum daily rolling 8-hour maximum O3 CO. \"daqi\": Daily Air Quality Index (DAQI). See details index defined. Note data_type available locally managed monitoring networks. pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. hc Include hydrocarbon measurements imported data? Defaults FALSE users interested using hydrocarbon data. meta Append site type, latitude longitude selected site? Defaults FALSE. meteo Append modelled meteorological data, available? Defaults TRUE, return wind speed (ws), wind direction (wd) ambient temperature (air_temp). variables calculated using WRF model run Ricardo Energy & Environment available networks. Setting meteo = FALSE useful meteorological data use preference, example worldmet package. ratified Append qc column(s) hourly data indicating whether species ratified (.e., quality-checked)? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. verbose Print messages console hourly data imported? Default FALSE. TRUE useful debugging specific year(s), site(s) source(s) imported returned. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"tibble","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"importing-uk-air-pollution-data","dir":"Reference","previous_headings":"","what":"Importing UK Air Pollution Data","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"family functions written make easy import data across several UK air quality networks. Ricardo provided .RData files (R workspaces) individual sites years, well date meta data. files updated daily basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. function also advantage proper site name imported used openair functions. Users take care using data openair web portals (example, UK AIR). One key difference data provided openair date beginning, whereas web portal provides date ending. Hourly concentrations may therefore appear offset hour, example. data imported stacking sites top one another field names site, code (site code) pollutant. default, function returns hourly average data. However, annual, monthly, daily 15 minute data (SO2) can returned using option data_type. Annual monthly data provide whole network information including data capture statistics. units expressed mass terms gaseous species (ug/m3 , NO2, NOx (NO2), SO2 hydrocarbons; mg/m3 CO). PM10 concentrations provided gravimetric units ug/m3 scaled comparable units. years variety instruments used measure particulate matter technical issues measuring PM10 complex. recent years measurements rely FDMS (Filter Dynamics Measurement System), able measure volatile component PM. cases FDMS system use separate volatile component recorded 'v10' non-volatile component 'nv10', already included absolute PM10 measurement. Prior use FDMS measurements used TEOM (Tapered Element Oscillating. Microbalance) concentrations multiplied 1.3 provide estimate total mass including volatile fraction. sites report hourly daily PM10 / PM2.5. data_type = \"daily\" hourly 'proper' daily measurements available, returned e.g. \"pm2.5\" \"gr_pm2.5\"; former corresponding data based original hourly measurements latter corresponding daily gravimetric measurements. function returns modelled hourly values wind speed (ws), wind direction (wd) ambient temperature (air_temp) available (generally around 2010). values modelled using WRF model operated Ricardo. BAM (Beta-Attenuation Monitor) instruments incorporated network throughout history scaled 1.3 heated inlet (account loss volatile particles) 0.83 heated inlet. TEOM instruments network 2008 scaled using VCM (Volatile Correction Model) values account loss volatile particles. object scaling processes provide reasonable degree comparison data sets reference method produce consistent data record operational period network, however may discontinuity time series associated instrument changes. corrections made PM2.5 data. volatile component FDMS PM2.5 (available) shown 'v2.5' column.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"David Carslaw, Trevor Davies, Jack Davison","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"","code":"if (FALSE) { # \\dontrun{ # import a single site from the AURN importUKAQ(\"my1\", year = 2022) # import sites from another network importUKAQ(c(\"bn1\", \"bn2\"), year = 2022, source = \"aqe\") # import sites across multiple networks importUKAQ(c(\"my1\", \"bn1\", \"bn2\"), year = 2022, source = c(\"aurn\", \"aqe\", \"aqe\") ) # get \"long\" format hourly data with a ratification flag importUKAQ( \"card\", source = \"waqn\", year = 2022, to_narrow = TRUE, ratified = TRUE ) # import other data types, filtering by pollutant importUKAQ( data_type = \"annual\", pollutant = c(\"no2\", \"pm2.5\", \"pm10\"), source = c(\"aurn\", \"aqe\") ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear relations between pollutants — linearRelation","title":"Linear relations between pollutants — linearRelation","text":"function considers linear relationships two pollutants. relationships calculated different times bases using linear model. slope 95% confidence interval slope relationships time unit plotted many ways. function particularly useful considering whether relationships consistent emissions inventories.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear relations between pollutants — linearRelation","text":"","code":"linearRelation( mydata, x = \"nox\", y = \"no2\", period = \"month\", condition = FALSE, n = 20, rsq.thresh = 0, ylab = paste0(\"slope from \", y, \" = m.\", x, \" + c\"), auto.text = TRUE, cols = \"grey30\", date.breaks = 5, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear relations between pollutants — linearRelation","text":"mydata data frame minimally containing date two pollutants. x First pollutant plotted appear x-axis relationship e.g. x = \"nox\". y Second pollutant plotted appear y-axis relationship e.g. y = \"pm10\". period range different time periods can analysed. default month can year week. increased flexibility integer can used e.g. 3-month values period = \"3 month\". cases include \"hour\" show diurnal relationship x y “weekday” day week relationship x y. “day.hour” plot relationship weekday hour day. condition period = \"hour\", period = \"day\" period = \"day.hour\", setting condition = TRUE plot relationships split year. useful seeing relationships may changing time. n minimum number points sent linear model. may points e.g. hours two pollutants available one week, n can set ensure least n points sent linear model. period hours < n period ignored. rsq.thresh minimum correlation coefficient (R2) allowed. relationship x y good particular period, setting rsq.thresh can help remove periods relationship strong. R2 values rsq.thresh plotted. ylab y-axis title, specified user. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. cols Colour points uncertainty intervals. date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters. useful one remove strip date range top plot set strip = FALSE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear relations between pollutants — linearRelation","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear relations between pollutants — linearRelation","text":"relationships pollutants can yield useful information source emissions change. scatterPlot two pollutants usual way investigate relationship. linear regression useful test strength relationship. However, considerably information can gleaned considering different time periods, relationship two pollutants vary time, day week, diurnally . linearRelation function just - fits linear relationship two pollutants wide range time periods determined period. linearRelation function particularly useful background concentrations first removed roadside concentrations, increment relate directly changes emissions. respect, using linearRelation can provide valuable information emissions may changed time, hour day etc. Using function way require users basic manipulation data first. data frame supplied contains nox, no2 o3, y can chosen y = \"ox\". function therefore consider total oxidant slope (sum NO2 + O3), can provide valuable information likely vehicle primary emissions. Note, however, roadside sites ozone measurements calcFno2 alternative.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Linear relations between pollutants — linearRelation","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear relations between pollutants — linearRelation","text":"","code":"# monthly relationship between NOx and SO2 - note rapid fall in # ratio at the beginning of the series linearRelation(mydata, x = \"nox\", y = \"so2\") # monthly relationship between NOx and SO2 - note rapid fall in # ratio at the beginning of the series if (FALSE) linearRelation(mydata, x = \"nox\", y = \"ox\") # \\dontrun{} # diurnal oxidant slope by year # clear change in magnitude # starting 2003, but the diurnal profile has also changed: the # morning and evening peak hours are more important, presumably # due to change in certain vehicle types if (FALSE) linearRelation(mydata, x = \"nox\", y = \"ox\", period = \"hour\", condition = TRUE) # \\dontrun{} # PM2.5/PM10 ratio, but only plot where monthly R2 >= 0.8 if (FALSE) linearRelation(mydata, x = \"pm10\", y = \"pm25\", rsq.thresh = 0.8) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate common model evaluation statistics — modStats","title":"Calculate common model evaluation statistics — modStats","text":"Function calculate common numerical model evaluation statistics flexible conditioning.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate common model evaluation statistics — modStats","text":"","code":"modStats( mydata, mod = \"mod\", obs = \"obs\", statistic = c(\"n\", \"FAC2\", \"MB\", \"MGE\", \"NMB\", \"NMGE\", \"RMSE\", \"r\", \"COE\", \"IOA\"), type = \"default\", rank.name = NULL, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate common model evaluation statistics — modStats","text":"mydata data frame. mod Name variable mydata represents modelled values. obs Name variable mydata represents measured values. statistic statistic calculated. See details description . type type determines data split .e. conditioned, plotted. default produce statistics using entire data. type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four sets statistics — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. one type can considered e.g. type = c(\"season\", \"weekday\") produce statistics split season day week. rank.name Simple model ranking can carried rank.name supplied. rank.name generally refer column representing model name, ranked. ranking based COE performance, indicator arguably best single model performance indicator available. ... Arguments passed cutData x data frame containing field date. hemisphere Can \"northern\" \"southern\", used split data seasons. n.levels Number quantiles split numeric data . start.day day week type = \"weekday\" start ? user can change start day supplying integer 0 6. Sunday = 0, Monday = 1, ... example start weekday plots Saturday, choose start.day = 6. .axis logical (TRUE/FALSE), used request shortened cut labels axes. local.tz Used identifying whether date daylight savings time (DST) applied . Examples include local.tz = \"Europe/London\", local.tz = \"America/New_York\" .e. time zones assume DST. https://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones shows time zones valid systems. important original data GMT (UTC) fixed offset GMT. See import openair manual information import data ensure DST applied. latitude decimal latitude used type = \"daylight\". longitude decimal longitude. Note locations west Greenwich negative.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate common model evaluation statistics — modStats","text":"Returns data frame model evaluation statistics.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate common model evaluation statistics — modStats","text":"function development currently provides common model evaluation statistics. include (mathematically defined later): \\(n\\), number complete pairs data. \\(FAC2\\), fraction predictions within factor two. \\(MB\\), mean bias. \\(MGE\\), mean gross error. \\(NMB\\), normalised mean bias. \\(NMGE\\), normalised mean gross error. \\(RMSE\\), root mean squared error. \\(r\\), Pearson correlation coefficient. Note, can also supply argument method e.g. method = \"spearman\". Also returned P value correlation coefficient, \\(P\\), may present 0 low values. \\(COE\\), Coefficient Efficiency based Legates McCabe (1999, 2012). many suggestions measuring model performance years, COE simple formulation easy interpret. perfect model COE = 1. noted Legates McCabe although COE lower bound, value COE = 0.0 fundamental meaning. implies model able predict observed values observed mean. Therefore, since model can explain variation observed values can observed mean, model can predictive advantage. negative values COE, model less effective observed mean predicting variation observations. \\(IOA\\), Index Agreement based Willmott et al. (2011), spans -1 +1 values approaching +1 representing better model performance. IOA 0.5, example, indicates sum error-magnitudes one half sum observed-deviation magnitudes. IOA = 0.0, signifies sum magnitudes errors sum observed-deviation magnitudes equivalent. IOA = -0.5, indicates sum error-magnitudes twice sum perfect model-deviation observed-deviation magnitudes. Values IOA near -1.0 can mean model-estimated deviations O poor estimates observed deviations; , also can mean simply little observed variability - caution needed IOA approaches -1. statistics based complete pairs mod obs. Conditioning possible setting type, can vector e.g. type = c(\"weekday\", \"season\").","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate common model evaluation statistics — modStats","text":"Legates DR, McCabe GJ. (1999). Evaluating use goodness--fit measures hydrologic hydroclimatic model validation. Water Resources Research 35(1): 233-241. Legates DR, McCabe GJ. (2012). refined index model performance: rejoinder, International Journal Climatology. Willmott, C.J., Robeson, S.M., Matsuura, K., 2011. refined index model performance. International Journal Climatology.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate common model evaluation statistics — modStats","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate common model evaluation statistics — modStats","text":"","code":"## the example below is somewhat artificial --- assuming the observed ## values are given by NOx and the predicted values by NO2. modStats(mydata, mod = \"no2\", obs = \"nox\") #> # A tibble: 1 × 12 #> default n FAC2 MB MGE NMB NMGE RMSE r P COE IOA #> #> 1 all data 63095 0.170 -130. 130. -0.725 0.726 167. 0.787 0 -0.337 0.331 ## evaluation stats by season modStats(mydata, mod = \"no2\", obs = \"nox\", type = \"season\") #> # A tibble: 4 × 12 #> season n FAC2 MB MGE NMB NMGE RMSE r P COE IOA #> #> 1 spring (… 17343 0.258 -108. 108. -0.685 0.685 140. 0.820 0 -0.250 0.375 #> 2 summer (… 14658 0.171 -116. 116. -0.705 0.705 145. 0.757 0 -0.420 0.290 #> 3 autumn (… 14775 0.0983 -154. 154. -0.753 0.753 192. 0.788 0 -0.437 0.281 #> 4 winter (… 16319 0.142 -143. 143. -0.749 0.751 185. 0.826 0 -0.321 0.340"},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":null,"dir":"Reference","previous_headings":"","what":"Example data for openair — mydata","title":"Example data for openair — mydata","text":"mydata dataset provided example dataset part openair package. dataset contains hourly measurements air pollutant concentrations, wind speed wind direction collected Marylebone (London) air quality monitoring supersite 1st January 1998 23rd June 2005. data set tibble.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example data for openair — mydata","text":"","code":"mydata"},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Example data for openair — mydata","text":"Data frame 65533 observations (rows) 10 variables: date Observation date/time stamp year-month-day hour:minute:second format (POSIXct). ws Wind speed, m/s, numeric vector. wd Wind direction, degrees North, numeric vector. nox Oxides nitrogen concentration, ppb, numeric vector. no2 Nitrogen dioxide concentration, ppb, numeric vector. o3 Ozone concentration, ppb, numeric vector. pm10 Particulate PM10 fraction measurement, ug/m3 (raw TEOM), numeric vector. so2 Sulfur dioxide concentration, ppb, numeric vector. co Carbon monoxide concentration, ppm, numeric vector. pm25 Particulate PM2.5 fraction measurement, ug/m3, numeric vector.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Example data for openair — mydata","text":"mydata compiled data archived London Air Quality Archive. See https://www.londonair.org.uk site details.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Example data for openair — mydata","text":"mydata supplied openair package example dataset use documented examples.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Example data for openair — mydata","text":"openair functions generally require data frames field \"date\" can either POSIXct Date format","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example data for openair — mydata","text":"","code":"#basic structure head(mydata) #> # A tibble: 6 × 10 #> date ws wd nox no2 o3 pm10 so2 co pm25 #> #> 1 1998-01-01 00:00:00 0.6 280 285 39 1 29 4.72 3.37 NA #> 2 1998-01-01 01:00:00 2.16 230 NA NA NA 37 NA NA NA #> 3 1998-01-01 02:00:00 2.76 190 NA NA 3 34 6.83 9.60 NA #> 4 1998-01-01 03:00:00 2.16 170 493 52 3 35 7.66 10.2 NA #> 5 1998-01-01 04:00:00 2.4 180 468 78 2 34 8.07 8.91 NA #> 6 1998-01-01 05:00:00 3 190 264 42 0 16 5.50 3.05 NA"},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":null,"dir":"Reference","previous_headings":"","what":"Pre-defined openair colours and definition of user-defined colours — openColours","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"primarily internal openair function make easy users select particular colour schemes, define range colours user-defined length.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"","code":"openColours(scheme = \"default\", n = 100)"},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"scheme one pre-defined openair schemes (e.g., \"increment\") user-defined palette (e.g., c(\"red\", \"orange\", \"gold\")). See ?openColours full list available schemes. n number colours required.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"character vector hex codes","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"schemes","dir":"Reference","previous_headings":"","what":"Schemes","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"following schemes made available openColours(): Sequential Colours: \"default\", \"increment\", \"brewer1\", \"heat\", \"jet\", \"turbo\", \"hue\", \"greyscale\". Simplified versions viridis colours: \"viridis\", \"plasma\", \"magma\", \"inferno\", \"cividis\", \"turbo\". Simplified versions RColorBrewer sequential palettes: \"Blues\", \"BuGn\", \"BuPu\", \"GnBu\", \"Greens\", \"Greys\", \"Oranges\", \"OrRd\", \"PuBu\", \"PuBuGn\", \"PuRd\", \"Purples\", \"RdPu\", \"Reds\", \"YlGn\", \"YlGnBu\", \"YlOrBr\", \"YlOrRd\". Diverging Palettes: Simplified versions RColorBrewer diverging palettes: \"BrBG\", \"PiYG\", \"PRGn\", \"PuOr\", \"RdBu\", \"RdGy\", \"RdYlBu\", \"RdYlGn\", \"Spectral\". Qualitative Palettes: Simplified versions RColorBrewer qualitative palettes: \"Accent\", \"Dark2\", \"Paired\", \"Pastel1\", \"Pastel2\", \"Set1\", \"Set2\", \"Set3\". \"okabeito\" (\"cbPalette\"), colour-blind safe palette based work Masataka Okabe Kei Ito (https://jfly.uni-koeln.de/color/) \"tol.bright\" (\"tol\"), \"tol.muted\" \"tol.light\", colour-blind safe palettes based work Paul Tol (https://personal.sron.nl/~pault/) \"tableau\" \"observable\", aliases \"Tableau10\" (https://www.tableau.com/blog/colors-upgrade-tableau-10-56782) \"Observable10\" (https://observablehq.com/blog/crafting-data-colors) colour palettes. useful consistency openair plots figures made Tableau Observable Plot. UK Government Palettes: \"daqi\" \"daqi.bands\", colours associated UK daily air quality index; \"daqi\" (palette 10 colours, corresponding index value) \"daqi.bands\" (4 colours, corresponding band - Low, Moderate, High, High). colours taken directly https://uk-air.defra.gov.uk/air-pollution/daqi may useful figures like calendarPlot(). \"gaf.cat\", \"gaf.focus\" \"gaf.seq\", colours recommended UK Government Analysis function (https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours--charts/). \"gaf.cat\" return 'categorical' palette (max 6 colours), \"gaf.focus\" 'focus' palette (max 2 colours), \"gaf.seq\" 'sequential' palette.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"way many schemes developed exist certain number colour gradations (typically 3–10) — see ?brewer.pal actual details. less required number colours supplied openair interpolate colours. pre-defined schemes merits use depend particular situation. showing incrementing concentrations, e.g., high concentrations emphasised, \"default\", \"heat\", \"jet\", \"turbo\", \"increment\" useful. See also description RColorBrewer schemes option scheme. colour-code categorical-type problems, e.g., colours different pollutants, \"hue\" \"brewer1\" useful. publishing black white, \"greyscale\" often convenient. openair functions, well generating greyscale colour gradient, also resets strip background coloured text lines greyscale values. Failing , user can define schemes based R colour names. see full list names, type colors() R.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"https://colorbrewer2.org/ https://uk-air.defra.gov.uk/air-pollution/daqi https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours--charts/","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"David Carslaw Jack Davison","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"","code":"# to return 5 colours from the \"jet\" scheme: cols <- openColours(\"jet\", 5) cols #> [1] \"#00007F\" \"#007FFF\" \"#7FFF7F\" \"#FF7F00\" \"#7F0000\" # to interpolate between named colours e.g. 10 colours from yellow to # green to red: cols <- openColours(c(\"yellow\", \"green\", \"red\"), 10) cols #> [1] \"#FFFF00\" \"#C6FF00\" \"#8DFF00\" \"#55FF00\" \"#1CFF00\" \"#1CE200\" \"#54AA00\" #> [8] \"#8D7100\" \"#C63800\" \"#FF0000\""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":null,"dir":"Reference","previous_headings":"","what":"openair: Tools for the Analysis of Air Pollution Data — openair-package","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"Tools analyse, interpret understand air pollution data. Data typically regular time series air quality measurement, meteorological data dispersion model output can analysed. package described Carslaw Ropkins (2012, doi:10.1016/j.envsoft.2011.09.008 ) subsequent papers.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"UK Natural Environment Research Council (NERC) funded knowledge exchange project aims make available innovative analysis tools air pollution data; additional support Defra. tools generally developed analyse data hourly resolution (least regular time series) air pollution monitoring dispersion modelling. availability meteorological data time resolution greatly enhances capabilities tools. openair contains collection functions analyse air pollution data. Typically expected data hourly means, although functions consider time periods. principal aim make available analysis techniques users air quality data model output normally access . functions consist developed authors growing number researchers. package also provides access wide range data sources including UK Automatic Urban Rural Network (AURN), networks run King's College London (e.g. LAQN) Scottish Air Quality Network (SAQN). package number requirements input data discussed manual (available openair website https://davidcarslaw.github.io/openair/). key requirements date date-time field must name date' (can \\code{Date} \\code{POSIXct} format), wind speed represented ws' wind direction `wd'. functions work straightforward way, offer many options finer control perhaps -depth analysis. openair package depends several packages written people function properly. ensure packages available, need installed, requires connection internet. packages required come R base system. problems automatic download packages, see https://davidcarslaw.github.io/openair/ details. NOTE: openair assumes data expressed local time 'Daylight Saving Time' used. functions check case issue warning TRUE. recommended data expressed UTC/GMT (fixed offset ) avoid potential problems R openair functions. openair manual provides advice issues (available website). check see openair correctly installed, try examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"the-openair-class","dir":"Reference","previous_headings":"","what":"The openair class","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"well generating plots , openair plotting functions also return object class “openair”. object includes three main components: call, command used generate plot. data, data frame summarised information used make plot. plot, plot . retained, e.g., using output <- polarPlot(mydata, \"nox\"), output can used recover data, reproduce rework original plot undertake analysis. openair output can manipulated using number generic operations, including print, plot summary. examples show examples using openair object.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"reference details given specific functions. principal reference users may also wish cite manual (details contained manual ). Carslaw, D.C. K. Ropkins, (2012) openair — R package air quality data analysis. Environmental Modelling & Software. Volume 27-28, 52-61.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"Maintainer: David Carslaw david.carslaw@york.ac.uk (ORCID) Authors: Jack Davison jack.davison@ricardo.com (ORCID) Karl Ropkins K.Ropkins@.leeds.ac.uk (ORCID)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"","code":"if (FALSE) { # \\dontrun{ # load package library(openair) # summarise data in a compact way summaryPlot(mydata) # traditional wind rose windRose(mydata) # polar plot polar_nox <- polarPlot(mydata, pollutant = \"nox\") # see call polar_nox$call # get data polar_nox$data # could, e.g., re-plot in {ggplot2} library(ggplot2) ggplot(polar_nox$data, aes(u, v, fill = z)) + geom_tile() + coord_equal() + scale_fill_gradientn(colours = openair::openColours(), na.value = NA) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to plot percentiles by wind direction — percentileRose","title":"Function to plot percentiles by wind direction — percentileRose","text":"percentileRose plots percentiles wind direction flexible conditioning. plot can display multiple percentile lines filled areas.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to plot percentiles by wind direction — percentileRose","text":"","code":"percentileRose( mydata, pollutant = \"nox\", wd = \"wd\", type = \"default\", percentile = c(25, 50, 75, 90, 95), smooth = FALSE, method = \"default\", cols = \"default\", angle = 10, mean = TRUE, mean.lty = 1, mean.lwd = 3, mean.col = \"grey\", fill = TRUE, intervals = NULL, angle.scale = 45, auto.text = TRUE, key.header = NULL, key.footer = \"percentile\", key.position = \"bottom\", key = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to plot percentiles by wind direction — percentileRose","text":"mydata data frame minimally containing wd numeric field plot — pollutant. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". one pollutant can supplied e.g. pollutant = c(\"no2\", \"o3\") provided one type. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. percentile percentile value(s) plot. Must 0–100. percentile = NA mean line shown. smooth wind direction data smoothed using cyclic spline? method method = \"default\" supplied percentiles wind direction calculated. method = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples wind sector y mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. angle Default angle “spokes” smooth = FALSE. mean Show mean wind direction line? mean.lty Line type mean line. mean.lwd Line width mean line. mean.col Line colour mean line. fill percentile intervals filled (default) lines drawn (fill = FALSE). intervals User-supplied intervals scale e.g. intervals = c(0, 10, 30, 50) angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData lattice:xyplot. example, percentileRose passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common graphical arguments, xlim ylim plotting ranges lwd line thickness using fill = FALSE, passed xyplot, although local modifications may applied openair. example, axis title labelling options (xlab, ylab main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to plot percentiles by wind direction — percentileRose","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to plot percentiles by wind direction — percentileRose","text":"percentileRose calculates percentile levels pollutant plots wind direction. One percentile levels can calculated displayed either filled areas lines. wind directions rounded nearest 10 degrees, consistent surface data UK Met Office smooth fitted. levels wind direction optionally calculated using cyclic smooth cubic spline using option smooth. smooth = FALSE data shown 10 degree sectors. percentileRose function compliments similar functions including windRose, pollutionRose, polarFreq polarPlot. useful showing distribution concentrations wind direction often can reveal different sources e.g. affect high percentile concentrations chimney stack. Similar functions, flexible conditioning available type option. easy example consider multiple percentile values pollutant season, year . See examples . percentileRose also offers great flexibility scale used user fine control range, interval colour.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Function to plot percentiles by wind direction — percentileRose","text":"Ashbaugh, L.L., Malm, W.C., Sadeh, W.Z., 1985. residence time probability analysis sulfur concentrations ground canyon national park. Atmospheric Environment 19 (8), 1263-1270.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to plot percentiles by wind direction — percentileRose","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to plot percentiles by wind direction — percentileRose","text":"","code":"# basic percentile plot percentileRose(mydata, pollutant = \"o3\") # 50/95th percentiles of ozone, with different colours percentileRose(mydata, pollutant = \"o3\", percentile = c(50, 95), col = \"brewer1\") if (FALSE) { # \\dontrun{ # percentiles of ozone by year, with different colours percentileRose(mydata, type = \"year\", pollutant = \"o3\", col = \"brewer1\") # percentile concentrations by season and day/nighttime.. percentileRose(mydata, type = c(\"season\", \"daylight\"), pollutant = \"o3\", col = \"brewer1\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":null,"dir":"Reference","previous_headings":"","what":"Bivariate polarAnnulus plot — polarAnnulus","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"Typically plots concentration pollutant wind direction function time annulus. function good visualising concentrations pollutants vary wind direction time period e.g. month, day week.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"","code":"polarAnnulus( mydata, pollutant = \"nox\", resolution = \"fine\", local.tz = NULL, period = \"hour\", type = \"default\", statistic = \"mean\", percentile = NA, limits = NULL, cols = \"default\", width = \"normal\", min.bin = 1, exclude.missing = TRUE, date.pad = FALSE, force.positive = TRUE, k = c(20, 10), normalise = FALSE, key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"mydata data frame minimally containing date, wd pollutant. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). resolution Two plot resolutions can set: “normal” “fine” (default). local.tz results calculated local time includes treatment daylight savings time (DST)? default consider DST issues, provided data imported without DST offset. Emissions activity tends occur local time e.g. rush hour 8 every day. clocks go forward spring, emissions effectively released atmosphere typically 1 hour earlier summertime .e. DST applies. plotting diurnal profiles, effect “smearing-” concentrations. Sometimes, useful approach express time local time. correction tends produce better-defined diurnal profiles concentration (variables) allows better comparison made emissions/activity data. set FALSE GMT used. Examples usage include local.tz = \"Europe/London\", local.tz = \"America/New_York\". See cutData import details. period determines temporal period consider. Options “hour” (default, plot diurnal variations), “season” plot variation throughout year, “weekday” plot day week variation “trend” plot trend wind direction. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"site\") produce 2x2 plot split season site. use two types mostly meant situations several sites. Note, two types provided first forms columns second rows. Also note polarAnnulus function type/period combinations forbidden make little sense. example, type = \"season\" period = \"trend\" (result plot many gaps sensible smoothing), type = \"weekday\" period = \"weekday\". statistic statistic applied wind speed/direction bin. Can “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean” “cpf” (Conditional Probability Function). smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean. percentile statistic = \"percentile\" statistic = \"cpf\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. width width annulus; can “normal” (default), “thin” “fat”. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. date.pad type = \"trend\" (default), date.pad = TRUE pad-missing data beginning first year end last year. purpose ensure trend plot begins ends beginning end year. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing value supplied gam temporal wind direction components, respectively. cases e.g. trend plot less 1-year data smoothing default values may become noisy affected outliers. Choosing lower value k (say 10) may help produce better plot. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:levelplot cutData. example, polarAnnulus passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed levelplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"polarAnnulus function shares many properties polarPlot. However, polarAnnulus focussed displaying information concentrations pollutant (values another variable) vary wind direction time. Plotting annulus helps reduce compression information towards centre plot. circular plot easy interpret wind direction easily understood polar rather Cartesian coordinates. inner part annulus represents earliest time outer part annulus latest time. time dimension can shown many ways including \"trend\", \"hour\" (hour day), \"season\" (month year) \"weekday\" (day week). Taking hour example, plot show concentrations vary hour day wind direction. plots can useful understanding different source influences affect location. type = \"trend\" amount smoothing vary linearly length time series .e. certain amount smoothing per unit interval time. deliberate choice one interested subset (time) data, detail provided subset compared full data set. allows users investigate specific periods detail. Full flexibility given smoothing parameter k.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"","code":"# diurnal plot for PM10 at Marylebone Rd if (FALSE) polarAnnulus(mydata, pollutant = \"pm10\", main = \"diurnal variation in pm10 at Marylebone Road\") # \\dontrun{} # seasonal plot for PM10 at Marylebone Rd if (FALSE) polarAnnulus(mydata, poll=\"pm10\", period = \"season\") # \\dontrun{} # trend in coarse particles (PMc = PM10 - PM2.5), calculate PMc first mydata$pmc <- mydata$pm10 - mydata$pm25 if (FALSE) polarAnnulus(mydata, poll=\"pmc\", period = \"trend\", main = \"trend in pmc at Marylebone Road\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":null,"dir":"Reference","previous_headings":"","what":"K-means clustering of bivariate polar plots — polarCluster","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Function identifying clusters bivariate polar plots (polarPlot()); identifying clusters original data subsequent processing.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-means clustering of bivariate polar plots — polarCluster","text":"","code":"polarCluster( mydata, pollutant = \"nox\", x = \"ws\", wd = \"wd\", n.clusters = 6, after = NA, cols = \"Paired\", angle.scale = 315, units = x, auto.text = TRUE, plot = TRUE, plot.data = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-means clustering of bivariate polar plots — polarCluster","text":"mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". one pollutant can chosen. x Name variable plot wind direction polar coordinates, default wind speed, “ws”. wd Name wind direction field. n.clusters Number clusters use. n.clusters length 1, lattice panel plot output showing clusters identified one n.clusters. function can applied differences polar plot surfaces (see polarDiff details). data frame supplied, clustering carried differences mydata way polarDiff. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. plot.data default, data component polarCluster() contains original data frame appended new \"cluster\" column. plot.data = TRUE, data component instead contains data reproduce clustered polar plot (similar data returned polarPlot()). may useful re-plotting polarCluster() plot ways. ... Arguments passed polarPlot type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-means clustering of bivariate polar plots — polarCluster","text":"openair object. object includes four main components: call, command used generate plot; data, default original data frame new field cluster identifying cluster, clust_stats giving contributions made cluster number measurements, percentage percentage pollutant; plot, plot . Note rows value pollutant NA ignored returned data frame may fewer rows original. clustering carried considering differences, .e., data frame supplied, output also includes data frame cluster identified.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Bivariate polar plots generated using polarPlot function provide useful graphical technique identifying characterising different air pollution sources. bivariate polar plots provide useful graphical indication potential sources, location wind-speed variable dependence, several limitations. Often, `feature' detected plot subsequent analysis data meeting particular wind speed/direction criteria based judgement investigator concerning wind speed-direction intervals interest. Furthermore, identification feature can depend choice colour scale used, making process somewhat arbitrary. polarCluster applies Partition Around Medoids (PAM) clustering techniques polarPlot() surfaces help identify potentially interesting features analysis. Details PAM can found cluster package (core R package pre-installed R systems). PAM clustering similar k-means several advantages e.g. robust outliers. clustering based equal contribution assumed u v wind components associated concentration. data standardized clustering takes place. function works best first trying different numbers clusters plotting . achieved setting n.clusters length 1. example, n.clusters = 2:10 plot output showing 9 cluster levels 2 10. clustering can also applied differences polar plot surfaces (see polarDiff()). case second data frame () supplied. Note clustering computationally intensive function can take long time run — particularly number clusters increased. reason can good idea run clusters first get feel e.g. n.clusters = 2:5. number clusters decided, user can run polarCluster return original data frame together new column cluster, gives cluster number character (see example). Note rows value pollutant NA ignored returned data frame may fewer rows original. Note automatic ways ensuring appropriate number clusters application dependent. However, often -priori information available different features polar plots correspond . Nevertheless, appropriateness different clusters best determined post-processing data. Carslaw Beevers (2012) paper discusses issues detail. Note unlike openair functions single type “default” allowed.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Carslaw, D.C., Beevers, S.D, Ropkins, K M.C. Bell (2006). Detecting quantifying aircraft -airport contributions ambient nitrogen oxides vicinity large international airport. Atmospheric Environment. 40/28 pp 5424-5434. Carslaw, D.C., & Beevers, S.D. (2013). Characterising understanding emission sources using bivariate polar plots k-means clustering. Environmental Modelling & Software, 40, 325-329. doi:10.1016/j.envsoft.2012.09.005","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-means clustering of bivariate polar plots — polarCluster","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-means clustering of bivariate polar plots — polarCluster","text":"","code":"if (FALSE) { # \\dontrun{ ## plot 2-8 clusters. Warning! This can take several minutes... polarCluster(mydata, pollutant = \"nox\", n.clusters = 2:8) # basic plot with 6 clusters results <- polarCluster(mydata, pollutant = \"nox\", n.clusters = 6) ## get results, could read into a new data frame to make it easier to refer to ## e.g. results <- results$data... head(results$data) ## how many points are there in each cluster? table(results$data$cluster) ## plot clusters 3 and 4 as a timeVariation plot using SAME colours as in ## cluster plot timeVariation(subset(results$data, cluster %in% c(\"3\", \"4\")), pollutant = \"nox\", group = \"cluster\", col = openColours(\"Paired\", 6)[c(3, 4)] ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":null,"dir":"Reference","previous_headings":"","what":"Polar plots considering changes in concentrations between two time periods — polarDiff","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"function provides way showing differences concentrations two time periods polar plot. several uses function, common see source(s) may changed two periods.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"","code":"polarDiff( before, after, pollutant = \"nox\", x = \"ws\", limits = NULL, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"data frame represents \"\" case. See polarPlot() details different input requirements. data frame represents \"\" case. See polarPlot() details different input requirements. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). pair-wise statistics Pearson correlation regression techniques plotted, pollutant takes two elements . example, pollutant = c(\"bc\", \"pm25\") \"bc\" function \"pm25\". x Name variable plot wind direction polar coordinates, default wind speed, “ws”. limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... Arguments passed polarPlot mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"openair plot.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"function primarily intended compare two time periods location, can used two data sets contain pollutant. example, data two sites close one another, two co-located instruments. analysis works calculating polar plot surface periods subtracting surface surface.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"","code":"if (FALSE) { # \\dontrun{ before_data <- selectByDate(mydata, year = 2002) after_data <- selectByDate(mydata, year = 2003) polarDiff(before_data, after_data, pollutant = \"no2\") # with some options polarDiff(before_data, after_data, pollutant = \"no2\", cols = \"RdYlBu\", limits = c(-20, 20)) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"polarFreq primarily plots wind speed-direction frequencies ‘bins’. bin colour-coded depending frequency measurements. Bins can also used show concentration pollutants using range commonly used statistics.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"","code":"polarFreq( mydata, pollutant = NULL, statistic = \"frequency\", ws.int = 1, wd.nint = 36, grid.line = 5, breaks = NULL, cols = \"default\", trans = TRUE, type = \"default\", min.bin = 1, ws.upper = NA, offset = 10, border.col = \"transparent\", key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"mydata data frame minimally containing ws, wd date. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\" statistic statistic applied wind speed/direction bin. Can “frequency”, “mean”, “median”, “max” (maximum), “stdev” (standard deviation) “weighted.mean”. option “frequency” (default) simplest plots frequency wind speed/direction different bins. scale therefore shows counts bin. option “mean” plot mean concentration pollutant (see next point) wind speed/direction bins, . Finally, “weighted.mean” plot concentration pollutant weighted wind speed/direction. segment therefore provides percentage overall contribution total concentration. information given examples. Note options “frequency”, necessary also provide name pollutant. See function cutData details. ws.int Wind speed interval assumed. cases e.g. low met mast, interval 0.5 may appropriate. wd.nint Number intervals wind direction. grid.line Radial spacing grid lines. breaks user can provide scale. breaks expects sequence numbers define range scale. sequence represent one equal spacing e.g. breaks = seq(0, 100, 10) - scale 0-10 intervals 10, flexible sequence e.g. breaks = c(0, 1, 5, 7, 10), may useful situations. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. trans transformation applied? Sometimes producing plots kind can dominated high points. default therefore TRUE square-root transform applied. results non-linear scale (usually) better representation distribution. set FALSE linear scale used. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. ws.upper user-defined upper wind speed use. useful ensuring consistent scale different plots. example, always ensure wind speeds displayed 1-10, set ws.int = 10. offset offset controls size ‘hole’ middle expressed percentage maximum wind speed. Setting higher offset e.g. 50 useful statistic = \"weighted.mean\" ws.int greater maximum wind speed. See example . border.col colour boundary wind speed/direction bin. default transparent. Another useful choice sometimes \"white\". key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:xyplot cutData. example, polarFreq passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"polarFreq default use provides details wind speed direction frequencies. respect similar windRose, considers wind direction intervals 10 degrees user-specified wind speed interval. frequency wind speeds/directions formed ‘bins’ represented colour scale. polarFreq function flexible either windRose() polarPlot(). can, example, also consider pollutant concentrations (see examples ). Instead number data points bin, concentration can shown. , range statistics can used describe bin - see statistic . Plotting mean concentrations useful source identification polarPlot() without smoothing, may preferable data. Plotting statistic = \"weighted.mean\" particularly useful understanding relative importance different source contributions. example, high mean concentrations may observed high wind speed conditions, weighted mean concentration may well show contribution overall concentrations low. polarFreq also offers great flexibility scale used user fine control range, interval colour.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"","code":"# basic wind frequency plot polarFreq(mydata) # wind frequencies by year if (FALSE) polarFreq(mydata, type = \"year\") # \\dontrun{} # mean SO2 by year, showing only bins with at least 2 points if (FALSE) polarFreq(mydata, pollutant = \"so2\", type = \"year\", statistic = \"mean\", min.bin = 2) # \\dontrun{} # weighted mean SO2 by year, showing only bins with at least 2 points if (FALSE) polarFreq(mydata, pollutant = \"so2\", type = \"year\", statistic = \"weighted.mean\", min.bin = 2) # \\dontrun{} #windRose for just 2000 and 2003 with different colours if (FALSE) polarFreq(subset(mydata, format(date, \"%Y\") %in% c(2000, 2003)), type = \"year\", cols = \"turbo\") # \\dontrun{} # user defined breaks from 0-700 in intervals of 100 (note linear scale) if (FALSE) polarFreq(mydata, breaks = seq(0, 700, 100)) # \\dontrun{} # more complicated user-defined breaks - useful for highlighting bins # with a certain number of data points if (FALSE) polarFreq(mydata, breaks = c(0, 10, 50, 100, 250, 500, 700)) # \\dontrun{} # source contribution plot and use of offset option if (FALSE) polarFreq(mydata, pollutant = \"pm25\", statistic =\"weighted.mean\", offset = 50, ws.int = 25, trans = FALSE) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Function for plotting bivariate polar plots with smoothing. — polarPlot","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"Function plotting pollutant concentration polar coordinates showing concentration wind speed (another numeric variable) direction. Mean concentrations calculated wind speed-direction ‘bins’ (e.g. 0-1, 1-2 m/s,... 0-10, 10-20 degrees etc.). aid interpretation, gam smoothing carried using mgcv.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"","code":"polarPlot( mydata, pollutant = \"nox\", x = \"ws\", wd = \"wd\", type = \"default\", statistic = \"mean\", limits = NULL, exclude.missing = TRUE, uncertainty = FALSE, percentile = NA, cols = \"default\", weights = c(0.25, 0.5, 0.75), min.bin = 1, mis.col = \"grey\", upper = NA, angle.scale = 315, units = x, force.positive = TRUE, k = 100, normalise = FALSE, key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, ws_spread = 1.5, wd_spread = 5, x_error = NA, y_error = NA, kernel = \"gaussian\", formula.label = TRUE, tau = 0.5, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). pair-wise statistics Pearson correlation regression techniques plotted, pollutant takes two elements . example, pollutant = c(\"bc\", \"pm25\") \"bc\" function \"pm25\". x Name variable plot wind direction polar coordinates, default wind speed, “ws”. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:levelplot cutData. example, polarPlot passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed levelplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"openair object. data contains four set columns: cond, conditioning based type; u v, translational vectors based ws wd; local pollutant estimate.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"bivariate polar plot useful diagnostic tool quickly gaining idea potential sources. Wind speed one useful variables use separate source types (see references). example, ground-level concentrations resulting buoyant plumes chimney stacks tend peak higher wind speed conditions. Conversely, ground-level, non-buoyant plumes road traffic, tend highest concentrations low wind speed conditions. sources aircraft engines also show differing characteristics wind speed. function developed allow variables wind speed plotted wind direction polar coordinates. key issue variable plotted wind direction discriminating way. example, temperature can help reveal high-level sources brought ground level unstable atmospheric conditions, show effect source emission dependent temperature e.g. biogenic isoprene. plots can vary considerably depending much smoothing done. approach adopted based flexible capable mgcv package uses Generalized Additive Models. methods exist find optimum level smoothness, necessarily useful. principal aim polarPlot graphical analysis rather quantitative purposes. respect smoothing aims strike balance revealing interesting (real) features overly noisy data. defaults used polarPlot() based analysis data many different sources. advanced users may wish modify code adopt smoothing approaches. Various statistics possible consider e.g. mean, maximum, median. statistic = \"max\" often useful revealing sources. Pair-wise statistics two pollutants can also calculated. function can also used compare two pollutant species range pair-wise statistics (see help statistic) Grange et al. (2016) (open-access publication link ). Wind direction split 10 degree intervals variable (e.g. wind speed) 30 intervals. 2D bins used calculate statistics. plots often show interesting features higher wind speeds (see references ). conditions can measurements therefore greater uncertainty calculation surface. several ways issue can tackled. First, possible avoid smoothing altogether use polarFreq(). Second, effect setting minimum number measurements wind speed-direction bin can examined min.bin. possible single point high wind speed conditions can strongly affect surface prediction. Therefore, setting min.bin = 3, example, remove wind speed-direction bins fewer 3 measurements fitting surface. Third, consider setting uncertainty = TRUE. option show predicted surface together upper lower 95% confidence intervals, take account frequency measurements. Variants polarPlot include polarAnnulus() polarFreq().","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"Ashbaugh, L.L., Malm, W.C., Sadeh, W.Z., 1985. residence time probability analysis sulfur concentrations ground canyon national park. Atmospheric Environment 19 (8), 1263-1270. Carslaw, D.C., Beevers, S.D, Ropkins, K M.C. Bell (2006). Detecting quantifying aircraft -airport contributions ambient nitrogen oxides vicinity large international airport. Atmospheric Environment. 40/28 pp 5424-5434. Carslaw, D.C., & Beevers, S.D. (2013). Characterising understanding emission sources using bivariate polar plots k-means clustering. Environmental Modelling & Software, 40, 325-329. doi:10.1016/j.envsoft.2012.09.005 Henry, R.C., Chang, Y.S., Spiegelman, C.H., 2002. Locating nearby sources air pollution nonparametric regression atmospheric concentrations wind direction. Atmospheric Environment 36 (13), 2237-2244. Henry, R., Norris, G.., Vedantham, R., Turner, J.R., 2009. Source region identification using Kernel smoothing. Environ. Sci. Technol. 43 (11), 4090e4097. http:// dx.doi.org/10.1021/es8011723. Uria-Tellaetxe, . D.C. Carslaw (2014). Source identification using conditional bivariate Probability function. Environmental Modelling & Software, Vol. 59, 1-9. Westmoreland, E.J., N. Carslaw, D.C. Carslaw, . Gillah E. Bates (2007). Analysis air quality within street canyon using statistical dispersion modelling techniques. Atmospheric Environment. Vol. 41(39), pp. 9195-9205. Yu, K.N., Cheung, Y.P., Cheung, T., Henry, R.C., 2004. Identifying impact large urban airports local air quality nonparametric regression. Atmospheric Environment 38 (27), 4501-4507. Grange, S. K., Carslaw, D. C., & Lewis, . C. 2016. Source apportionment advances bivariate polar plots, correlation, regression techniques. Atmospheric Environment. 145, 128-134. https://www.sciencedirect.com/science/article/pii/S1352231016307166","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"","code":"# Use openair 'mydata' # basic plot polarPlot(openair::mydata, pollutant = \"nox\") if (FALSE) { # \\dontrun{ # polarPlots by year on same scale polarPlot(mydata, pollutant = \"so2\", type = \"year\", main = \"polarPlot of so2\") # set minimum number of bins to be used to see if pattern remains similar polarPlot(mydata, pollutant = \"nox\", min.bin = 3) # plot by day of the week polarPlot(mydata, pollutant = \"pm10\", type = \"weekday\") # show the 95% confidence intervals in the surface fitting polarPlot(mydata, pollutant = \"so2\", uncertainty = TRUE) # Pair-wise statistics # Pearson correlation polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"r\") # Robust regression slope, takes a bit of time polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"robust.slope\") # Least squares regression works too but it is not recommended, use robust # regression # polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"slope\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":null,"dir":"Reference","previous_headings":"","what":"Pollution rose variation of the traditional wind rose plot — pollutionRose","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"traditional wind rose plot plots wind speed wind direction different intervals. pollution rose applies plot structure substitutes measurements, commonly pollutant time series, wind speed.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"","code":"pollutionRose( mydata, pollutant = \"nox\", key.footer = pollutant, key.position = \"right\", key = TRUE, breaks = 6, paddle = FALSE, seg = 0.9, normalise = FALSE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"mydata data frame containing fields ws wd pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". key.footer Adds additional text/labels scale key. See key.header information. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. key Fine control scale key via drawOpenKey(). breaks commonly, number break points pollutant concentrations. default, 6, attempts breaks supplied data approximately 6 sensible break points. However, breaks can also used set specific break points. example, argument breaks = c(0, 1, 10, 100) breaks data segments <1, 1-10, 10-100, >100. paddle Either TRUE FALSE. TRUE plots rose using 'paddle' style spokes. FALSE plots rose using 'wedge' style spokes. seg paddle = TRUE, seg determines width segments. example, seg = 0.5 produce segments 0.5 * angle. normalise TRUE wind direction segment normalised equal one. useful showing concentrations (parameters) contribute wind sector proportion time wind direction low. line showing probability wind directions particular wind sector also shown. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... Arguments passed windRose ws Name column representing wind speed. wd Name column representing wind direction. ws2,wd2 user can supply second set wind speed wind direction values first can compared. See pollutionRose() details. ws.int Wind speed interval. Default 2 m/s low met masts low mean wind speeds value 1 0.5 m/s may better. angle Default angle “spokes” 30. potentially useful angles 45 10. Note width wind speed interval may need adjusting using width. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. calm.thresh default, conditions considered calm wind speed zero. user can set different threshold calms setting calm.thresh higher value. example, calm.thresh = 0.5 identify wind speeds 0.5 calm. bias.corr angle divide exactly 360 bias introduced frequencies wind direction already supplied rounded nearest 10 degrees, often case. example, angle = 22.5, N, E, S, W include 3 wind sectors angles two. bias correction can made correct problem. simple method according Applequist (2012) used adjust frequencies. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet”, “hue” user defined. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\", \"black\"). grid.line Grid line interval use. NULL, default, assigned based available data range. However, can also forced specific value, e.g. grid.line = 10. grid.line can also list control interval, line type colour. example grid.line = list(value = 10, lty = 5, col = \"purple\"). width paddle = TRUE, adjustment factor width wind speed intervals. example, width = 1.5 make paddle width 1.5 times wider. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly, e.g., subscripting ‘2’ NO2. offset size 'hole' middle plot, expressed percentage polar axis scale, default 10. max.freq Controls scaling used setting maximum value radial limits. useful ensure several plots use radial limits. key.header Adds additional text/labels scale key. example, passing windRose(mydata, key.header = \"ws\") adds addition text scale header. Note: argument passed drawOpenKey() via quickText(), applying auto.text argument, handle formatting. dig.lab number significant figures scientific number formatting used break point key labelling. Default 5. include.lowest Logical. FALSE (default), first interval left exclusive right inclusive. TRUE, first interval left right inclusive. Passed include.lowest argument cut(). statistic statistic applied data bin plot. Options currently include “prop.count”, “prop.mean” “abs.count”. default “prop.count” sizes bins according proportion frequency measurements. Similarly, “prop.mean” sizes bins according relative contribution mean. “abs.count” provides absolute count measurements bin. annotate TRUE percentage calm mean values printed panel together description statistic plot. \" \" statistic plot. Custom annotations may added setting value c(\"annotation 1\", \"annotation 2\"). angle.scale scale default shown 315 degree angle. Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale another value (0 360 degrees) mitigate problems. example angle.scale = 45 draw scale heading NE direction. border Border colour shaded areas. Default border.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"openair object. Summarised proportions can extracted directly using $data operator, e.g. object$data output <- windRose(mydata). returns data frame three set columns: cond, conditioning based type; wd, wind direction; calm, statistic proportion data unattributed specific wind direction collected calm conditions; several (one range binned plot) columns giving proportions measurements associated ws pollutant range plotted discrete panel.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"pollutionRose() windRose() wrapper brings pollutant forward argument list, attempts sensibly rescale break points based pollutant data range -passing ws.int. default, pollutionRose() plot pollution rose nox using \"wedge\" style segments placing scale key right plot. possible compare two wind speed-direction data sets using pollutionRose(). many reasons e.g. see one site compares another meteorological model evaluation. case, ws wd considered reference data sets second set wind speed wind directions compared (ws2 wd2). first set values subtracted second differences compared. example, wd2 biased positive compared wd pollutionRose show bias polar coordinates. default use, wind direction bias colour-coded show negative bias one colour positive bias another.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"","code":"# pollutionRose of nox pollutionRose(mydata, pollutant = \"nox\") ## source apportionment plot - contribution to mean if (FALSE) { # \\dontrun{ pollutionRose(mydata, pollutant = \"pm10\", type = \"year\", statistic = \"prop.mean\") } # } ## example of comparing 2 met sites ## first we will make some new ws/wd data with a postive bias mydata$ws2 = mydata$ws + 2 * rnorm(nrow(mydata)) + 1 mydata$wd2 = mydata$wd + 30 * rnorm(nrow(mydata)) + 30 ## need to correct negative wd id <- which(mydata$wd2 < 0) mydata$wd2[id] <- mydata$wd2[id] + 360 ## results show postive bias in wd and ws pollutionRose(mydata, ws = \"ws\", wd = \"wd\", ws2 = \"ws2\", wd2 = \"wd2\")"},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic text formatting for openair — quickText","title":"Automatic text formatting for openair — quickText","text":"Workhorse function automatically applies routine text formatting common expressions data names used openair.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic text formatting for openair — quickText","text":"","code":"quickText(text, auto.text = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic text formatting for openair — quickText","text":"text character vector. auto.text logical option. default, TRUE, applies quickText text returns result. alternative, FALSE, returns text unchanged. (number openair functions enable/disable quickText using option.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic text formatting for openair — quickText","text":"function returns expression graphical evaluation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatic text formatting for openair — quickText","text":"quickText routine formatting lookup table. screens supplied character vector text automatically applies formatting recognised character sub-series. function used number openair functions can also used directly users format text components graphs (see ).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic text formatting for openair — quickText","text":"Karl Ropkins.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic text formatting for openair — quickText","text":"","code":"#example 1 ##see axis formatting in an openair plot, e.g.: scatterPlot(mydata, x = \"no2\", y = \"pm10\") #example 2 ##using quickText in other plots plot(mydata$no2, mydata$pm10, xlab = quickText(\"my no2 label\"), ylab = quickText(\"pm10 [ ug.m-3 ]\"))"},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate rollingMean values — rollingMean","title":"Calculate rollingMean values — rollingMean","text":"Calculate rollingMean values taking account data capture thresholds","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate rollingMean values — rollingMean","text":"","code":"rollingMean( mydata, pollutant = \"o3\", width = 8, new.name = \"rolling\", data.thresh = 75, align = \"centre\", ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate rollingMean values — rollingMean","text":"mydata data frame containing date field. mydata must contain date field Date POSIXct format. input time series must regular e.g. hourly, daily. pollutant name pollutant e.g. pollutant = \"o3\". width averaging period (rolling window width) use e.g. width = 8 generate 8-hour rolling mean values hourly data analysed. new.name name given new rollingMean variable. supplied create name based name pollutant averaging period used. data.thresh data capture threshold %. values calculated data capture period interest less value. example, width = 8 data.thresh = 75 least 6 hours required calculate mean, else NA returned. align specifies moving window aligned. \"right\" means previous hours (including current) averaged. seems default UK air quality rolling mean statistics. \"left\" means forward hours averaged, \"centre\" \"center\", default. ... arguments, currently unused.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate rollingMean values — rollingMean","text":"utility function mostly designed calculate rolling mean statistics relevant pollutant limits e.g. 8 hour rolling means ozone 24 hour rolling means PM10. However, function general use helping display rolling mean values flexible ways e.g. rolling window width left, right centre aligned. function try fill missing time gaps get full time sequence return data frame number rows supplied.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate rollingMean values — rollingMean","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate rollingMean values — rollingMean","text":"","code":"## rolling 8-hour mean for ozone mydata <- rollingMean(mydata, pollutant = \"o3\", width = 8, new.name = \"rollingo3\", data.thresh = 75, align = \"right\")"},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":null,"dir":"Reference","previous_headings":"","what":"Rolling regression for pollutant source characterisation. — runRegression","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"function calculates rolling regressions input data set window width. principal use function identify \"dilution lines\" ratio two pollutant concentrations invariant. original idea based work Bentley (2004).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"","code":"runRegression(mydata, x = \"nox\", y = \"pm10\", run.len = 3, date.pad = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"mydata data frame columns date least two variables use regression. x column name x variable use linear regression y = m.x + c. y column name y variable use linear regression y = m.x + c. run.len window width used rolling regression. value 3 example hourly data consider 3 one-hour time sequences. date.pad gaps time series filled calculations made?","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"tibble date calculated regression coefficients information plot dilution lines.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"intended use apply approach air pollution data extract consecutive points time ratio two pollutant concentrations changes little. filtering output high R2 values (typically 0.90 0.95), conditions local source dilution dominant can isolated post processing. function fully described used openair online manual, together examples.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"original inspiration: Bentley, S. T. (2004). Graphical techniques constraining estimates aerosol emissions motor vehicles using air monitoring network data. Atmospheric Environment,(10), 1491–1500. https://doi.org/10.1016/j.atmosenv.2003.11.033 Example vehicle emissions high time resolution data: Farren, N. J., Schmidt, C., Juchem, H., Pöhler, D., Wilde, S. E., Wagner, R. L., Wilson, S., Shaw, M. D., & Carslaw, D. C. (2023). Emission ratio determination road vehicles using range remote emission sensing techniques. Science Total Environment, 875. https://doi.org/10.1016/j.scitotenv.2023.162621.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"","code":"# Just use part of a year of data output <- runRegression(selectByDate(mydata, year = 2004, month = 1:3), x = \"nox\", y = \"pm10\", run.len = 3) output #> # A tibble: 2,073 × 12 #> date date_start date_end intercept slope #> #> 1 2004-01-01 01:00:00 2004-01-01 00:00:00 2004-01-01 02:00:00 47.4 -0.199 #> 2 2004-01-01 02:00:00 2004-01-01 01:00:00 2004-01-01 03:00:00 2.15 0.0996 #> 3 2004-01-01 03:00:00 2004-01-01 02:00:00 2004-01-01 04:00:00 1.87 0.0898 #> 4 2004-01-01 04:00:00 2004-01-01 03:00:00 2004-01-01 05:00:00 2.39 0.0897 #> 5 2004-01-01 05:00:00 2004-01-01 04:00:00 2004-01-01 06:00:00 -10.6 0.297 #> 6 2004-01-01 06:00:00 2004-01-01 05:00:00 2004-01-01 07:00:00 20.0 -0.167 #> 7 2004-01-01 07:00:00 2004-01-01 06:00:00 2004-01-01 08:00:00 8.76 0.0129 #> 8 2004-01-01 08:00:00 2004-01-01 07:00:00 2004-01-01 09:00:00 5.81 0.0596 #> 9 2004-01-01 09:00:00 2004-01-01 08:00:00 2004-01-01 10:00:00 0.108 0.113 #> 10 2004-01-01 10:00:00 2004-01-01 09:00:00 2004-01-01 11:00:00 -5.59 0.149 #> # ℹ 2,063 more rows #> # ℹ 7 more variables: r_squared , nox_1 , nox_2 , pm10_1 , #> # pm10_2 , delta_nox , delta_pm10 "},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Flexible scatter plots — scatterPlot","title":"Flexible scatter plots — scatterPlot","text":"Scatter plots conditioning three main approaches: conventional scatterPlot, hexagonal binning kernel density estimates. former also options fitting smooth fits linear models uncertainties shown.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flexible scatter plots — scatterPlot","text":"","code":"scatterPlot( mydata, x = \"nox\", y = \"no2\", z = NA, method = \"scatter\", group = NA, avg.time = \"default\", data.thresh = 0, statistic = \"mean\", percentile = NA, type = \"default\", smooth = FALSE, spline = FALSE, linear = FALSE, ci = TRUE, mod.line = FALSE, cols = \"hue\", plot.type = \"p\", key = TRUE, key.title = group, key.columns = 1, key.position = \"right\", strip = TRUE, log.x = FALSE, log.y = FALSE, x.inc = NULL, y.inc = NULL, limits = NULL, windflow = NULL, y.relation = \"same\", x.relation = \"same\", ref.x = NULL, ref.y = NULL, k = NA, dist = 0.02, map = FALSE, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flexible scatter plots — scatterPlot","text":"mydata data frame containing least two numeric variables plot. x Name x-variable plot. Note x can date field factor. example, x can one openair built types \"year\" \"season\". y Name numeric y-variable plot. z Name numeric z-variable plot method = \"scatter\" method = \"level\". Note method = \"scatter\" points coloured according continuous colour scale, whereas method = \"level\" surface coloured. method Methods include “scatter” (conventional scatter plot), “hexbin” (hexagonal binning using hexbin package). “level” binned smooth surface plot “density” (2D kernel density estimates). group grouping variable use, . Setting variable data frame effect plotting several series panel using different symbols/colours etc. set variable character factor, categories factor levels used directly. set numeric variable, split variable quantiles. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". See function timeAverage details . option se useful one method number points plotted reduced .e. choosing longer averaging time. data.thresh data capture threshold use (\\ data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". statistic statistic apply aggregating data; default mean. Can one \"mean\", \"max\", \"min\", \"median\", \"frequency\", \"sd\", \"percentile\". Note \"sd\" standard deviation \"frequency\" number (frequency) valid records period. \"percentile\" percentile level (\\ \"percentile\" option - see . used avg.time = \"default\". percentile percentile level percent used statistic = \"percentile\" aggregating data avg.time. default 95. used avg.time = \"default\". type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. smooth smooth line fitted data TRUE; optionally 95 percent confidence intervals shown. method = \"level\" smooth surface fitted binned data. spline smooth spline fitted data TRUE. particularly useful fewer data points connection line sequence points required. linear linear model fitted data TRUE; optionally 95 percent confidence intervals shown. equation line R2 value also shown. ci confidence intervals smooth/linear fit shown? mod.line TRUE three lines added scatter plot help inform model evaluation. 1:1 line solid 1:0.5 1:2 lines dashed. Together lines help show close group points 1:1 relationship also show points within factor two (FAC2). mod.line appropriately transformed x y axes log scale. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") plot.type lattice plot type. Can “p” (points — default), “l” (lines) “b” (lines points). key key drawn? default TRUE. key.title title key (used). key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. strip strip drawn? default TRUE. log.x x-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. log.y y-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. x.inc x-interval used binning data method = \"level\". y.inc y-interval used binning data method = \"level\". limits method = \"level\" function best choose sensible limits automatically. However, circumstances user wish set different ones. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. windflow option allows scatter plot show wind speed/direction shows arrow. option list e.g. windflow = list(col = \"grey\", lwd = 2, scale = 0.1). option requires wind speed (ws) wind direction (wd) available. maximum length arrow plotted fraction plot dimension longest arrow scale plot x-y dimension. Note, plot size adjusted manually user re-plotted ensure correct wind angle. list may contain options panel.arrows lattice package. useful options include length, controls length arrow head angle, controls angle arrow head. option works best many data ensure -plotting become problem. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. k Smoothing parameter supplied gam fitting smooth surface method = \"level\". dist plotting smooth surfaces (method = \"level\" smooth = TRUE, dist controls far original data predictions made. See exclude..far mgcv package. Data first transformed unit square. Values 0 1. map base map drawn? option development. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData appropriate lattice plot function (xyplot, levelplot hexbinplot depending method). example, scatterPlot passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, default case method = \"scatter\" common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting. common graphical parameters, e.g. layout panel arrangement, pch plot symbol lwd lty line width type, also available (see examples ). method = \"hexbin\" can useful transform scale dominated high values. possible supplying two functions: one applies transformation inverses . log scaling (default) example, trans = function(x) log(x) inv = function(x) exp(x). square root transform use trans = sqrt inv = function(x) x^2. carry transformation options trans = NULL inv = NULL used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flexible scatter plots — scatterPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Flexible scatter plots — scatterPlot","text":"scatterPlot() basic function plotting scatter plots flexible ways openair. flexible enough consider lots conditioning variables takes care fitting smooth linear relationships data. four main ways plotting relationship two variables, set using method option. default \"scatter\" plot conventional scatterPlot. cases lots data -plotting becomes problem, method = \"hexbin\" method = \"density\" can useful. former requires hexbin package installed. also method = \"level\" bin x y data according intervals set x.inc y.inc colour bins according levels third variable, z. Sometimes however, far better understanding relationship three variables (x, y z) gained fitting smooth surface data. See examples . smooth fit shown smooth = TRUE can help show overall form data e.g. whether relationship appears linear . Also, linear fit can shown using linear = TRUE option. user fine control choice colours symbol type used. Another way reducing number points used plots can sometimes useful aggregate data. example, hourly data can aggregated daily data. See timePlot() examples . default plots shown colour key bottom case conditioning, strips top plot. Sometimes may overkill user can opt remove key /strip setting key /strip FALSE. One reason maximise plotting area therefore information shown.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Flexible scatter plots — scatterPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Flexible scatter plots — scatterPlot","text":"","code":"# load openair data if not loaded already dat2004 <- selectByDate(mydata, year = 2004) # basic use, single pollutant scatterPlot(dat2004, x = \"nox\", y = \"no2\") if (FALSE) { # \\dontrun{ # scatterPlot by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\") } # } # scatterPlot by day of the week, removing key at bottom scatterPlot(dat2004, x = \"nox\", y = \"no2\", type = \"weekday\", key = FALSE) # example of the use of continuous where colour is used to show # different levels of a third (numeric) variable # plot daily averages and choose a filled plot symbol (pch = 16) # select only 2004 if (FALSE) { # \\dontrun{ scatterPlot(dat2004, x = \"nox\", y = \"no2\", z = \"co\", avg.time = \"day\", pch = 16) # show linear fit, by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE) # do the same, but for daily means... scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE, avg.time = \"day\") # log scales scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE, avg.time = \"day\", log.x = TRUE, log.y = TRUE) # also works with the x-axis in date format (alternative to timePlot) scatterPlot(mydata, x = \"date\", y = \"no2\", avg.time = \"month\", key = FALSE) ## multiple types and grouping variable and continuous colour scale scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", type = c(\"season\", \"weekend\")) # use hexagonal binning library(hexbin) # basic use, single pollutant scatterPlot(mydata, x = \"nox\", y = \"no2\", method = \"hexbin\") # scatterPlot by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", method = \"hexbin\") ## bin data and plot it - can see how for high NO2, O3 is also high scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", method = \"level\", dist = 0.02) ## fit surface for clearer view of relationship - clear effect of ## increased O3 scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", method = \"level\", x.inc = 10, y.inc = 2, smooth = TRUE) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset a data frame based on date — selectByDate","title":"Subset a data frame based on date — selectByDate","text":"Utility function make easier select periods data frame sending function","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset a data frame based on date — selectByDate","text":"","code":"selectByDate( mydata, start = \"1/1/2008\", end = \"31/12/2008\", year = 2008, month = 1, day = \"weekday\", hour = 1 )"},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset a data frame based on date — selectByDate","text":"mydata data frame containing date field hourly high resolution format. start start date string form d/m/yyyy e.g. “1/2/1999” ‘R’ format .e. “YYYY-mm-dd”, “1999-02-01” end See start format. year year years select e.g. year = 1998:2004 select 1998-2004 inclusive year = c(1998, 2004) select 1998 2004. month month months select. Can either numeric e.g. month = 1:6 select months 1-6 (January June), name e.g. month = c(\"January\", \"December\"). Names can abbreviated 3 letters lower upper case. day day name days select. day can numeric (1 31) character. example day = c(\"Monday\", \"Wednesday\") day = 1:10 (select 1st 10th month). Names can abbreviated 3 letters lower upper case. Also accepts “weekday” (Monday - Friday) “weekend” convenience. hour hour hours select 0-23 e.g. hour = 0:12 select hours 0 12 inclusive.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subset a data frame based on date — selectByDate","text":"function makes much easier select periods interest data frame based dates British format. Selecting date/times R format can intimidating new users. function can used select quite complex dates simply - see examples . Dates assumed inclusive, start = \"1/1/1999\" means times selected hour zero. Similarly, end = \"31/12/1999\" include hours 31st December. start end can also standard R format string .e. \"YYYY-mm-dd\", start = \"1999-01-01\" fine. options applied turn making possible select quite complex dates","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset a data frame based on date — selectByDate","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subset a data frame based on date — selectByDate","text":"","code":"## select all of 1999 data.1999 <- selectByDate(mydata, start = \"1/1/1999\", end = \"31/12/1999\") head(data.1999) #> # A tibble: 6 × 10 #> date ws wd nox no2 o3 pm10 so2 co pm25 #> #> 1 1999-01-01 00:00:00 5.04 140 88 35 4 21 3.84 1.02 18 #> 2 1999-01-01 01:00:00 4.08 160 132 41 3 17 5.24 2.7 11 #> 3 1999-01-01 02:00:00 4.8 160 168 40 4 17 6.51 2.87 8 #> 4 1999-01-01 03:00:00 4.92 150 85 36 3 15 4.18 1.62 10 #> 5 1999-01-01 04:00:00 4.68 150 93 37 3 16 4.25 1.02 11 #> 6 1999-01-01 05:00:00 3.96 160 74 29 5 14 3.88 0.725 NA tail(data.1999) #> # A tibble: 6 × 10 #> date ws wd nox no2 o3 pm10 so2 co pm25 #> #> 1 1999-12-31 18:00:00 4.68 190 226 39 NA 29 5.46 2.38 23 #> 2 1999-12-31 19:00:00 3.96 180 202 37 NA 27 4.78 2.15 23 #> 3 1999-12-31 20:00:00 3.36 190 246 44 NA 30 5.88 2.45 23 #> 4 1999-12-31 21:00:00 3.72 220 231 35 NA 28 5.28 2.22 23 #> 5 1999-12-31 22:00:00 4.08 200 217 41 NA 31 4.79 2.17 26 #> 6 1999-12-31 23:00:00 3.24 200 181 37 NA 28 3.48 1.78 22 # or... data.1999 <- selectByDate(mydata, start = \"1999-01-01\", end = \"1999-12-31\") # easier way data.1999 <- selectByDate(mydata, year = 1999) # more complex use: select weekdays between the hours of 7 am to 7 pm sub.data <- selectByDate(mydata, day = \"weekday\", hour = 7:19) # select weekends between the hours of 7 am to 7 pm in winter (Dec, Jan, Feb) sub.data <- selectByDate(mydata, day = \"weekend\", hour = 7:19, month = c(\"dec\", \"jan\", \"feb\"))"},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to extract run lengths greater than a threshold — selectRunning","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"Utility function extract user-defined run lengths (durations) threshold","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"","code":"selectRunning( mydata, pollutant = \"nox\", criterion = \">\", run.len = 5, threshold = 500, result = c(\"yes\", \"no\") )"},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"mydata data frame date field least one numeric pollutant field analyse. pollutant Name variable process. Mandatory. criterion Condition select run lengths e.g. \">\" select data threshold. run.len Run length extracting contiguous values pollutant threshold value. threshold threshold value pollutant data extracted. result new column criterion returned string identity whether condition met.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"Returns data frame meets chosen criteria. See examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"utility function extract runs values certain threshold. example, data frame hourly NOx values like extract hours concentration least 500ppb contiguous periods 5 hours. function useful, example, selecting pollution episodes data frame .e. concentrations remain elevated certain period time. may also general use analysing air pollution data. example, selectRunning used extract continuous periods rainfall — important particle concentrations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectRunning.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to extract run lengths greater than a threshold — selectRunning","text":"","code":"## extract those hours where there are at least 5 consecutive NOx ## concentrations above 500ppb mydata <- selectRunning(mydata, run.len = 5, threshold = 500) ## make a polar plot of those conditions...shows that those ## conditions are dominated by low wind speeds, not ## in-canyon recirculation if (FALSE) polarPlot(mydata, pollutant = \"nox\", type = \"criterion\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate nonparametric smooth trends — smoothTrend","title":"Calculate nonparametric smooth trends — smoothTrend","text":"Use non-parametric methods calculate time series trends","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate nonparametric smooth trends — smoothTrend","text":"","code":"smoothTrend( mydata, pollutant = \"nox\", deseason = FALSE, type = \"default\", statistic = \"mean\", avg.time = \"month\", percentile = NA, data.thresh = 0, simulate = FALSE, n = 200, autocor = FALSE, cols = \"brewer1\", shade = \"grey95\", xlab = \"year\", y.relation = \"same\", ref.x = NULL, ref.y = NULL, key.columns = length(percentile), name.pol = pollutant, ci = TRUE, alpha = 0.2, date.breaks = 7, auto.text = TRUE, k = NULL, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate nonparametric smooth trends — smoothTrend","text":"mydata data frame containing field date least one parameter trend test required; typically (necessarily) pollutant. pollutant parameter trend test required. Mandatory. deseason data de-deasonalized first? TRUE function stl used (seasonal trend decomposition using loess). Note TRUE missing data first imputed using Kalman filter Kalman smooth. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic Statistic used calculating monthly values. Default “mean”, can also “percentile”. See timeAverage details. avg.time Can “month” (default), “season” “year”. Determines time data averaged. Note “year”, six years required. “season” data plit spring: March, April, May etc. Note December considered belonging winter following year. percentile Percentile value(s) use statistic = \"percentile\" chosen. Can vector numbers e.g. percentile = c(5, 50, 95) plot 5th, 50th 95th percentile values together plot. data.thresh data capture threshold use (%) aggregating data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". simulate simulations carried determine Mann-Kendall tau p-value. default FALSE. TRUE, bootstrap simulations undertaken, also account autocorrelation. n Number bootstrap simulations simulate = TRUE. autocor autocorrelation considered trend uncertainty estimates? default FALSE. Generally, accounting autocorrelation increases uncertainty trend estimate sometimes large amount. cols Colours use. Can vector colours e.g. cols = c(\"black\", \"green\") pre-defined openair colours — see openColours details. shade colour used marking alternate years. Use “white” “transparent” remove shading. xlab x-axis label, default “year”. y.relation determines y-axis scale plotted. \"\" ensures panels use scale \"free\" use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. case correct date format used vertical line e.g. ref.x = list(v = .POSIXct(\"2000-06-15\"), lty = 5). ref.x See ref.y. ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. key.columns Number columns used key drawn using option statistic = \"percentile\". name.pol Names given pollutant(s). useful want give fuller description variables, maybe also including subscripts etc. ci confidence intervals plotted? default FALSE. alpha alpha transparency shaded confidence intervals - plotted. value 0 fully transparent 1 fully opaque. date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. k smoothing parameter used gam function package mgcv. default used amount smoothing optimised automatically. However, sometimes useful set smoothing amount manually using k. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData lattice:xyplot. example, smoothTrend passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common graphical arguments, xlim ylim plotting ranges pch cex plot symbol type size, passed xyplot, although local modifications may applied openair. example, axis title labelling options (xlab, ylab main) passed xyplot via quickText handle routine formatting. One special case many graphical parameters can vectors used statistic = \"percentile\" vector percentile values, see examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate nonparametric smooth trends — smoothTrend","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate nonparametric smooth trends — smoothTrend","text":"smoothTrend function provides flexible way estimating trend concentration pollutant variable. Monthly mean values calculated hourly (higher resolution) daily time series. option deseasonalise data evidence seasonal cycle. smoothTrend uses Generalized Additive Model (GAM) gam package find appropriate level smoothing. function particularly suited situations trends monotonic (see discussion TheilSen() details ). smoothTrend function particularly useful exploratory technique e.g. check linear non-linear trends . 95% confidence intervals shown shading. Bootstrap estimates confidence intervals also available simulate option. Residual resampling used. Trends can considered wide range ways, controlled setting type - see examples .","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate nonparametric smooth trends — smoothTrend","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/smoothTrend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate nonparametric smooth trends — smoothTrend","text":"","code":"# trend plot for nox smoothTrend(mydata, pollutant = \"nox\") # trend plot by each of 8 wind sectors if (FALSE) smoothTrend(mydata, pollutant = \"o3\", type = \"wd\", ylab = \"o3 (ppb)\") # \\dontrun{} # several pollutants, no plotting symbol if (FALSE) smoothTrend(mydata, pollutant = c(\"no2\", \"o3\", \"pm10\", \"pm25\"), pch = NA) # \\dontrun{} # percentiles if (FALSE) smoothTrend(mydata, pollutant = \"o3\", statistic = \"percentile\", percentile = 95) # \\dontrun{} # several percentiles with control over lines used if (FALSE) smoothTrend(mydata, pollutant = \"o3\", statistic = \"percentile\", percentile = c(5, 50, 95), lwd = c(1, 2, 1), lty = c(5, 1, 5)) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide up a data frame by time — splitByDate","title":"Divide up a data frame by time — splitByDate","text":"Utility function prepare input data use openair functions","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Divide up a data frame by time — splitByDate","text":"","code":"splitByDate( mydata, dates = \"1/1/2003\", labels = c(\"before\", \"after\"), name = \"split.by\" )"},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide up a data frame by time — splitByDate","text":"mydata data frame containing date field hourly high resolution format. dates date dates split data . labels Labels time partition. name name give new column identify periods split","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Divide up a data frame by time — splitByDate","text":"function partitions data frame different time segments. produces new column called controlled name can used many openair functions. Note must one label dates. See examples full openair documentation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Divide up a data frame by time — splitByDate","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/splitByDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Divide up a data frame by time — splitByDate","text":"","code":"## split data up into \"before\" and \"after\" mydata <- splitByDate(mydata, dates = \"1/04/2000\", labels = c(\"before\", \"after\")) ## split data into 3 partitions: mydata <- splitByDate(mydata, dates = c(\"1/1/2000\", \"1/3/2003\"), labels = c(\"before\", \"during\", \"after\"))"},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to rapidly provide an overview of air quality data — summaryPlot","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"function provides quick graphical numerical summary data. location presence/absence data shown, summary statistics plots variable distributions. summaryPlot() can also provide summaries single pollutant across many sites.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"","code":"summaryPlot( mydata, na.len = 24, clip = TRUE, percentile = 0.99, type = \"histogram\", pollutant = \"nox\", period = \"years\", avg.time = \"day\", print.datacap = TRUE, breaks = NULL, plot.type = \"l\", col.trend = \"darkgoldenrod2\", col.data = \"lightblue\", col.mis = rgb(0.65, 0.04, 0.07), col.hist = \"forestgreen\", cols = NULL, date.breaks = 7, auto.text = TRUE, plot = TRUE, debug = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"mydata data frame summarised. Must contain date field least one parameter. na.len Missing data shown least na.len contiguous missing vales. purpose setting na.len clarity: long time series difficult see individual missing hours . Furthermore, setting na.len = 96, example show least 4 days continuous missing data. clip data contain outliers, histogram density plot can fail show distribution main body data. Setting clip = TRUE, remove top 1 % data yield often better display overall distribution data. amount clipping can set percentile. percentile used clip data. example, percentile = 0.99 (default) remove top 1 percentile values .e. values greater 99th percentile used. type type used determine whether histogram (default) density plot used show distribution data. pollutant pollutant used field site one site data frame. period period either years (default) months. Statistics calculated depending period chosen. avg.time defines time period average time series plots. Can \"sec\", \"min\", \"hour\", \"day\" (default), \"week\", \"month\", \"quarter\" \"year\". much increased flexibility number can precede options followed space. example, timeAverage() 2 months avg.time = \"2 month\". print.datacap data capture % shown period? breaks Number histogram bins. Sometime useful easy set single value range different variables. plot.type lattice plot type, line (plot.type = \"l\") default. Another useful option plot.type = \"h\", draws vertical lines. col.trend Colour used show monthly trend data, shown shaded region. Type colors() R see full range colour names. col.data Colour used show presence data. Type colors() R see full range colour names. col.mis Colour used show missing data. col.hist Colour histogram density plot. cols Predefined colour scheme, currently enabled \"greyscale\". date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly, e.g., subscripting '2' NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. debug data types printed console? TRUE can useful debugging. ... graphical parameters. Commonly used examples include axis title labelling options (xlab, ylab main), passed plot via quickText() handle routine formatting. summaryPlot() two components, axis labels may vector. example, default case (type = \"histogram\") sets y labels equivalent ylab = c(\"\", \"Percent Total\").","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"summaryPlot() produces two panels plots: one showing presence/absence data distributions. left panel shows time series codes presence absence data different colours. stacking plots one top another easy compare different pollutants/variables. Overall statistics given variable: mean, maximum, minimum, missing hours (also expressed percentage), median 95th percentile. year data capture rate (expressed percentage hours year) also given. right panel shows either histogram density plot depending choice type. Density plots avoid issue arbitrary bin sizes can sometimes provide misleading view data distribution. Density plots often appropriate, effectiveness depend data question. summaryPlot() show data numeric integer type. useful checking data imported properly. example, reason column representing wind speed erroneously one fields characters , whole column either character factor type. absence wind speed variable summaryPlot() plot therefore indicate problem input data. particular case, user go back source data remove characters remove using R functions. field site, generally mean one site, summaryPlot() provide information single pollutant across sites, rather provide details pollutants single site. case user also provide name pollutant e.g. pollutant = \"nox\". pollutant provided first numeric field automatically chosen. strongly recommended summaryPlot() function applied new imported data sets ensure data imported expected.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/summaryPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to rapidly provide an overview of air quality data — summaryPlot","text":"","code":"# do not clip density plot data if (FALSE) { # \\dontrun{ summaryPlot(mydata, clip = FALSE) } # } # exclude highest 5 % of data etc. if (FALSE) { # \\dontrun{ summaryPlot(mydata, percentile = 0.95) } # } # show missing data where there are at least 96 contiguous missing # values (4 days) if (FALSE) { # \\dontrun{ summaryPlot(mydata, na.len = 96) } # } # show data in green if (FALSE) { # \\dontrun{ summaryPlot(mydata, col.data = \"green\") } # } # show missing data in yellow if (FALSE) { # \\dontrun{ summaryPlot(mydata, col.mis = \"yellow\") } # } # show density plot line in black if (FALSE) { # \\dontrun{ summaryPlot(mydata, col.dens = \"black\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to calculate time averages for data frames — timeAverage","title":"Function to calculate time averages for data frames — timeAverage","text":"Function flexibly aggregate expand data frames different time periods, calculating vector-averaged wind direction appropriate. averaged periods can also take account data capture rates.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to calculate time averages for data frames — timeAverage","text":"","code":"timeAverage( mydata, avg.time = \"day\", data.thresh = 0, statistic = \"mean\", type = \"default\", percentile = NA, start.date = NA, end.date = NA, interval = NA, vector.ws = FALSE, fill = FALSE, progress = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to calculate time averages for data frames — timeAverage","text":"mydata data frame containing date field . Can class POSIXct Date. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". addition, avg.time can equal “season”, case 3-month seasonal values calculated spring defined March, April, May . Note avg.time can less time interval original series, case series expanded new time interval. useful, example, calculating 15-minute time series hourly one hourly value repeated new 15-minute period. Note expanding data way necessary ensure time interval original series exact multiple avg.time e.g. hour 10 minutes, day hour. Also, input time series must consistent time gaps successive intervals timeAverage can work much ‘padding’ apply. pad-data way choose fill = TRUE. data.thresh data capture threshold use (%). value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. See also interval, start.date end.date see whether advisable set options. statistic statistic apply aggregating data; default mean. Can one “mean”, “max”, “min”, “median”, “frequency”, “sum”, “sd”, “percentile”. Note “sd” standard deviation, “frequency” number (frequency) valid records period “data.cap” percentage data capture. “percentile” percentile level (%) 0-100, can set using “percentile” option — see . used avg.time = \"default\". type type allows timeAverage applied cases groups data need split function applied group. common example data multiple sites identified column representing site name e.g. type = \"site\". generally, type used date repeats particular grouping variable. However, type supplied data still averaged grouping variables (character factor) dropped. percentile percentile level used statistic = \"percentile\". default 95%. start.date string giving start date use. sometimes useful time series starts obvious intervals. example, 1-minute time series starts “2009-11-29 12:07:00” needs averaged 15-minute means, intervals “2009-11-29 12:07:00”, “2009-11-29 12:22:00” etc. Often, however, better round obvious start point e.g. “2009-11-29 12:00:00” sequence “2009-11-29 12:00:00”, “2009-11-29 12:15:00” ... start.date therefore used force type sequence. end.date string giving end date use. sometimes useful make sure time series extends known end point useful data.thresh > 0 input time series extend final full interval. example, time series ends sometime October annual means required data capture >75 % necessary extend time series end year. Input format yyyy-mm-dd HH:MM. interval timeAverage function tries determine interval original time series (e.g. hourly) calculating common interval time steps. interval needed calculations data.thresh >0. vast majority regular time series works fine. However, data poor data capture irregular time series automatic detection may work. Also, time series monthly time series variable difference time months users specify time interval explicitly e.g. interval = \"month\". Users can also supply time interval force time series. See avg.time format. option can sometimes useful start.date end.date ensure full periods considered e.g. full year avg.time = \"year\". vector.ws vector averaging carried wind speed available? default FALSE scalar averages calculated. Vector averaging wind speed carried u v wind components. example, consider average two hours wind direction speed first hour 0 degrees 2m/s 180 degrees 2m/s second hour. scalar average wind speed simply arithmetic average = 2m/s vector average 0m/s. Vector-averaged wind speeds always lower scalar-averaged values. fill time series expanded .e. time interval less original time series, data ‘padded ’ NA. ‘pad-’ additional data first row original time interval, choose fill = TRUE. progress Show progress bar many groups make type? Defaults TRUE. ... Additional arguments functions calling timeAverage.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to calculate time averages for data frames — timeAverage","text":"Returns data frame date class POSIXct.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to calculate time averages for data frames — timeAverage","text":"function calculates time averages data frame. also treats wind direction correctly vector-averaging. example, average 350 degrees 10 degrees either 0 360 - 180. calculations therefore average wind components. data capture threshold set data.thresh necessary timeAverage know original time interval input time series . function try calculate interval based common time gap (print assumed time gap screen). works fine time occasions may e.g. data exist data frame data monthly (.e. non-regular time interval months). case user can explicitly specify interval interval format avg.time e.g. interval = \"month\". may also useful set start.date end.date time series span entire period interest. example, time series ended October annual means required, setting end.date end year ensure whole period covered data.thresh correctly calculated. also goes time series starts later year start.date set beginning year. timeAverage useful many circumstances necessary work different time average data. example, hourly air pollution data 15-minute meteorological data. merge two data sets timeAverage can used make meteorological data 1-hour means first. Alternatively, timeAverage can used expand hourly data 15 minute data - see example . research community timeAverage useful dealing outputs instruments range time periods used. also useful plotting data using timePlot. Often data dense see patterns setting different averaging periods easily helps interpretation.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to calculate time averages for data frames — timeAverage","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeAverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to calculate time averages for data frames — timeAverage","text":"","code":"## daily average values daily <- timeAverage(mydata, avg.time = \"day\") ## daily average values ensuring at least 75 % data capture ## i.e. at least 18 valid hours if (FALSE) daily <- timeAverage(mydata, avg.time = \"day\", data.thresh = 75) # \\dontrun{} ## 2-weekly averages if (FALSE) fortnight <- timeAverage(mydata, avg.time = \"2 week\") # \\dontrun{} ## make a 15-minute time series from an hourly one if (FALSE) { # \\dontrun{ min15 <- timeAverage(mydata, avg.time = \"15 min\", fill = TRUE) } # } # average by grouping variable if (FALSE) { # \\dontrun{ dat <- importAURN(c(\"kc1\", \"my1\"), year = 2011:2013) timeAverage(dat, avg.time = \"year\", type = \"site\") # can also retain site code timeAverage(dat, avg.time = \"year\", type = c(\"site\", \"code\")) # or just average all the data, dropping site/code timeAverage(dat, avg.time = \"year\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot time series — timePlot","title":"Plot time series — timePlot","text":"Plot time series quickly, perhaps multiple pollutants, grouped separate panels.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot time series — timePlot","text":"","code":"timePlot( mydata, pollutant = \"nox\", group = FALSE, stack = FALSE, normalise = NULL, avg.time = \"default\", data.thresh = 0, statistic = \"mean\", percentile = NA, date.pad = FALSE, type = \"default\", cols = \"brewer1\", plot.type = \"l\", key = TRUE, log = FALSE, windflow = NULL, smooth = FALSE, ci = TRUE, y.relation = \"same\", ref.x = NULL, ref.y = NULL, key.columns = 1, key.position = \"bottom\", name.pol = pollutant, date.breaks = 7, date.format = NULL, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot time series — timePlot","text":"mydata data frame time series. Must include date field least one variable plot. pollutant Name variable plot. Two pollutants can plotted, case form like pollutant = c(\"nox\", \"co\") used. group one pollutant chosen, plotted graph together? default FALSE, means plotted separate panels scaled. TRUE plotted plot scale. stack TRUE time series stacked year. option can useful several years worth data making difficult see much detail plotted single plot. normalise variables normalised? default normalise data. normalise can take two values, either “mean” string representing date UK format e.g. \"1/1/1998\" (format dd/mm/YYYY). normalise = \"mean\" time series divided mean value. date chosen, values date set 100 rest data scaled accordingly. Choosing date (say beginning time series) useful showing trends diverge time. Setting group = TRUE often useful show time series together one panel. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". See function timeAverage details . data.thresh data capture threshold use aggregating data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". statistic statistic apply aggregating data; default mean. Can one “mean”, “max”, “min”, “median”, “frequency”, “sd”, “percentile”. Note “sd” standard deviation “frequency” number (frequency) valid records period. “percentile” percentile level 0-100, can set using “percentile” option - see . used avg.time = \"default\". percentile percentile level percent used statistic = \"percentile\" aggregating data avg.time. one percentile level allowed type = \"default\" e.g. percentile = c(50, 95). used avg.time = \"default\". date.pad missing data padded-? useful data frame consists two \"chunks\" data time gaps . setting date.pad = TRUE time gaps chunks shown properly, rather line connecting chunk. irregular data, set FALSE. Note, set type default. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. one type currently allowed timePlot. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") plot.type lattice plot type, line (plot.type = \"l\") default. Another useful option plot.type = \"h\", draws vertical lines. key key drawn? default TRUE. log y-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful plotting data several different pollutants exist different scales. therefore useful use log = TRUE together group = TRUE. windflow option allows scatter plot show wind speed/direction arrow. option list e.g. windflow = list(col = \"grey\", lwd = 2, scale = 0.1). option requires wind speed (ws) wind direction (wd) available. maximum length arrow plotted fraction plot dimension longest arrow scale plot x-y dimension. Note, plot size adjusted manually user re-plotted ensure correct wind angle. list may contain options panel.arrows lattice package. useful options include length, controls length arrow head angle, controls angle arrow head. option works best many data ensure -plotting become problem. smooth smooth line applied data? default FALSE. ci smooth fit line applied, ci determines whether 95 percent confidence intervals shown. y.relation determines y-axis scale plotted. \"\" ensures panels use scale \"free\" use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. case correct date format used vertical line e.g. ref.x = list(v = .POSIXct(\"2000-06-15\"), lty = 5). ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Can include “top”, “bottom”, “right” “left”. name.pol option can used give alternative names variables plotted. Instead taking column headings names, user can supply replacements. example, column name “nox” user wanted different description, setting name.pol = \"nox change\" can used. one pollutant plotted use c e.g. name.pol = c(\"nox \", \"o3 \"). date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . date.format option controls date format x-axis. timePlot generally sets date format sensibly can situations user wishes control. format types see strptime. example, format date like “Jan-2012” set date.format = \"%b-%Y\". auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData lattice:xyplot. example, timePlot passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common plotting parameters, layout panel arrangement pch cex plot symbol type size lty lwd line type width, passed xyplot, although maybe locally managed openair route, e.g. axis title labelling options (xlab, ylab, main) passed via quickText handle routine formatting. See examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot time series — timePlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot time series — timePlot","text":"timePlot basic time series plotting function openair. purpose make quick easy plot time series pollutants variables. purpose plot potentially many variables together compact way possible. function flexible enough plot one variable . one variable chosen plots can either show variables plot (different line types) scale, (group = FALSE) variable panels scale. general preference plot two variables graph two different y-scales. can misleading difficult two variables. interest plotting several variables together different scales, can useful normalise data first, can setting normalise option. user fine control choice colours, line width line types used. useful example, emphasise particular variable specific line type/colour/width. timePlot works well selectByDate(), used selecting particular date ranges quickly easily. See examples . default plots shown colour key bottom case multiple pollutants sites, strips left plot. Sometimes may overkill user can opt remove key /strip setting key /strip FALSE. One reason maximise plotting area therefore information shown.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot time series — timePlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timePlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot time series — timePlot","text":"","code":"# basic use, single pollutant timePlot(mydata, pollutant = \"nox\") # two pollutants in separate panels if (FALSE) timePlot(mydata, pollutant = c(\"nox\", \"no2\")) # \\dontrun{} # two pollutants in the same panel with the same scale if (FALSE) timePlot(mydata, pollutant = c(\"nox\", \"no2\"), group = TRUE) # \\dontrun{} # alternative by normalising concentrations and plotting on the same scale #> function (x, center = TRUE, scale = TRUE) #> UseMethod(\"scale\") #> #> if (FALSE) { # \\dontrun{ timePlot(mydata, pollutant = c(\"nox\", \"co\", \"pm10\", \"so2\"), group = TRUE, avg.time = \"year\", normalise = \"1/1/1998\", lwd = 3, lty = 1) } # } # examples of selecting by date # plot for nox in 1999 if (FALSE) timePlot(selectByDate(mydata, year = 1999), pollutant = \"nox\") # \\dontrun{} # select specific date range for two pollutants if (FALSE) { # \\dontrun{ timePlot(selectByDate(mydata, start = \"6/8/2003\", end = \"13/8/2003\"), pollutant = c(\"no2\", \"o3\")) } # } # choose different line styles etc if (FALSE) timePlot(mydata, pollutant = c(\"nox\", \"no2\"), lty = 1) # \\dontrun{} # choose different line styles etc if (FALSE) { # \\dontrun{ timePlot(selectByDate(mydata, year = 2004, month = 6), pollutant = c(\"nox\", \"no2\"), lwd = c(1, 2), col = \"black\") } # } # different averaging times #daily mean O3 if (FALSE) timePlot(mydata, pollutant = \"o3\", avg.time = \"day\") # \\dontrun{} # daily mean O3 ensuring each day has data capture of at least 75% if (FALSE) timePlot(mydata, pollutant = \"o3\", avg.time = \"day\", data.thresh = 75) # \\dontrun{} # 2-week average of O3 concentrations if (FALSE) timePlot(mydata, pollutant = \"o3\", avg.time = \"2 week\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series plot with categories shown as a stacked bar chart — timeProp","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"function shows time series plots stacked bar charts. different categories bar chart made character factor variable data frame. function primarily developed support plotting cluster analysis output polarCluster trajCluster consider local regional (back trajectory) cluster analysis respectively. However, function general use understanding time series data.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"","code":"timeProp( mydata, pollutant = \"nox\", proportion = \"cluster\", avg.time = \"day\", type = \"default\", normalise = FALSE, cols = \"Set1\", date.breaks = 7, date.format = NULL, key.columns = 1, key.position = \"right\", key.title = proportion, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"mydata data frame containing fields date, pollutant splitting variable proportion pollutant Name pollutant plot contained mydata. proportion splitting variable makes bars bar chart e.g. proportion = \"cluster\" output polarCluster analysed. proportion numeric variable split 4 quantiles (default) cutData. proportion factor character variable categories used directly. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". Note avg.time used timeProp greater time gap original data. example, avg.time = \"day\" hourly data OK, avg.time = \"hour\" daily data . type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. \"season\", \"year\", \"weekday\" . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. type must length one. normalise normalise = TRUE time interval scaled 100. helpful show relative (percentage) contribution proportions. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . date.format option controls date format x-axis. timePlot generally sets date format sensibly can situations user wishes control. format types see strptime. example, format date like “Jan-2012” set date.format = \"%b-%Y\". key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. key.title title key. auto.text Either TRUE (default) FALSE. TRUE titles axis labels etc. automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto timeProp cutData. example, timeProp passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"order plot time series way, sort time aggregation needed, controlled option avg.time. plot shows value pollutant y-axis (averaged according avg.time). time intervals made bars split according proportion. bars therefore show total value pollutant made time interval.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeProp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series plot with categories shown as a stacked bar chart — timeProp","text":"","code":"## monthly plot of SO2 showing the contribution by wind sector timeProp(mydata, pollutant = \"so2\", avg.time = \"month\", proportion = \"wd\") #> Warning: 219 missing wind direction line(s) removed"},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":null,"dir":"Reference","previous_headings":"","what":"Diurnal, day of the week and monthly variation — timeVariation","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"Plots diurnal, day week monthly variation different variables, typically pollutant concentrations. Four separate plots produced.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"","code":"timeVariation( mydata, pollutant = \"nox\", local.tz = NULL, normalise = FALSE, xlab = c(\"hour\", \"hour\", \"month\", \"weekday\"), name.pol = pollutant, type = \"default\", group = NULL, difference = FALSE, statistic = \"mean\", conf.int = 0.95, B = 100, ci = TRUE, cols = \"hue\", ref.y = NULL, key = NULL, key.columns = 1, start.day = 1, panel.gap = 0.2, auto.text = TRUE, alpha = 0.4, month.last = FALSE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"mydata data frame hourly (higher temporal resolution data). Must include date field least one variable plot. pollutant Name variable plot. Two pollutants can plotted, case form like pollutant = c(\"nox\", \"co\") used. local.tz results calculated local time includes treatment daylight savings time (DST)? default consider DST issues, provided data imported without DST offset. Emissions activity tends occur local time e.g. rush hour 8 every day. clocks go forward spring, emissions effectively released atmosphere typically 1 hour earlier summertime .e. DST applies. plotting diurnal profiles, effect “smearing-” concentrations. Sometimes, useful approach express time local time. correction tends produce better-defined diurnal profiles concentration (variables) allows better comparison made emissions/activity data. set FALSE GMT used. Examples usage include local.tz = \"Europe/London\", local.tz = \"America/New_York\". See cutData import details. normalise variables normalised? default FALSE. TRUE variable(s) divided mean values. helps compare shape diurnal trends variables different scales. xlab x-axis label; one sub-plot. name.pol Names given pollutant(s). useful want give fuller description variables, maybe also including subscripts etc. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. one type allowed intimeVariation. group sets grouping variable used. example, data frame column site setting group = \"site\" plot sites together panel. See examples . difference two pollutants chosen setting difference = TRUE also plot difference means two variables pollutant[2] - pollutant[1]. Bootstrap 95\\ difference means also calculated. horizontal dashed line shown y = 0. difference can also calculated column identifies two groups e.g. used splitByDate. case possible call timeVariation option group = \"split.\" difference = TRUE. statistic Can “mean” (default) “median”. statistic ‘mean’ mean line 95\\ interval mean plotted default. statistic ‘median’ median line plotted together 5/95 25/75th quantiles plotted. Users can control confidence intervals conf.int. conf.int confidence intervals plotted. statistic = \"mean\" confidence intervals mean plotted. statistic = \"median\" conf.int 1 - conf.int quantiles plotted. conf.int can length 2, useful showing quantiles. example conf.int = c(0.75, 0.99) yield plot showing median, 25/75 5/95th quantiles. B Number bootstrap replicates use. Can useful reduce value large number observations available increase speed calculations without affecting 95\\ interval calculations much. ci confidence intervals shown? default TRUE. Setting FALSE can useful multiple pollutants chosen -lapping confidence intervals can complicate plots. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. key default timeVariation produces four plots one page. useful see plots together, sometimes necessary just use one report. key TRUE, key added plots allowing extraction single plot key. See example. key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. start.day day week plots start ? user can change start day supplying integer 0 6. Sunday = 0, Monday = 1, ... example start weekday plots Saturday, choose start.day = 6. panel.gap gap panels hour-day plot. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. alpha alpha transparency used plotting confidence intervals. 0 fully transparent 1 opaque. default 0.4 month.last order plots changed plot showing monthly means last plot logical hierarchy averaging periods? plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:xyplot cutData. example, case cutData option hemisphere = \"southern\".","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"openair object. four components timeVariation : day.hour, hour, day month. Associated data.frames can extracted directly using subset option, e.g. plot(object, subset = \"day.hour\"), summary(output, subset = \"hour\"), etc., output <- timeVariation(mydata, \"nox\")","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"variation pollutant concentrations hour day day week etc. can reveal many interesting features relate source types meteorology. traffic sources, often important differences way vehicles vary vehicles type e.g. less heavy vehicles weekends. timeVariation function makes easy see concentrations (many variable types) vary hour day day week. plots also show 95\\ confidence intervals mean calculated bootstrap simulations, provide robust estimates confidence intervals (particularly relatively data). function can handle multiple pollutants uses flexible type option provide separate panels 'type' — see cutData details. timeVariation can also accept group option useful data stacked. work similar way multiple pollutants separate columns. user can supply ylim e.g. ylim = c(0, 200) used plots. ylim can also list length four control y-limits individual plot e.g. ylim = list(c(-100,500), c(200, 300), c(-400,400), c(50,70)). pairs correspond hour, weekday, month day-hour plots respectively. option difference calculate difference means two pollutants together bootstrap estimates 95\\ difference mean. works two ways: either two pollutants supplied separate columns e.g. pollutant = c(\"no2\", \"o3\"), two unique values group. difference calculated second pollutant minus first labelled . Considering differences way can provide many useful insights particularly useful model evaluation information needed model differs observations many different time scales. manual contains various examples using difference = TRUE. Note also timeVariation function works well subset data conjunction plots. example, polarPlot may highlight interesting feature particular wind speed/direction range. filtering conditions timeVariation can help determine whether temporal variation feature differs features — help source identification. addition, timeVariation work well variables available. Examples include meteorological traffic flow data. Depending choice statistic, subheading added. Users can control text subheading use sub e.g. sub = \"\" remove subheading.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/timeVariation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diurnal, day of the week and monthly variation — timeVariation","text":"","code":"# basic use timeVariation(mydata, pollutant = \"nox\") # for a subset of conditions if (FALSE) { # \\dontrun{ timeVariation(subset(mydata, ws > 3 & wd > 100 & wd < 270), pollutant = \"pm10\", ylab = \"pm10 (ug/m3)\") } # } # multiple pollutants with concentrations normalised if (FALSE) timeVariation(mydata, pollutant = c(\"nox\", \"co\"), normalise = TRUE) # \\dontrun{} # show BST/GMT variation (see ?cutData for more details) # the NOx plot shows the profiles are very similar when expressed in # local time, showing that the profile is dominated by a local source # that varies by local time and not by GMT i.e. road vehicle emissions if (FALSE) timeVariation(mydata, pollutant = \"nox\", type = \"dst\", local.tz = \"Europe/London\") # \\dontrun{} ## In this case it is better to group the results for clarity: if (FALSE) timeVariation(mydata, pollutant = \"nox\", group = \"dst\", local.tz = \"Europe/London\") # \\dontrun{} # By contrast, a variable such as wind speed shows a clear shift when # expressed in local time. These two plots can help show whether the # variation is dominated by man-made influences or natural processes if (FALSE) timeVariation(mydata, pollutant = \"ws\", group = \"dst\", local.tz = \"Europe/London\") # \\dontrun{} ## It is also possible to plot several variables and set type. For ## example, consider the NOx and NO2 split by levels of O3: if (FALSE) timeVariation(mydata, pollutant = c(\"nox\", \"no2\"), type = \"o3\", normalise = TRUE) # \\dontrun{} ## difference in concentrations if (FALSE) timeVariation(mydata, poll= c(\"pm25\", \"pm10\"), difference = TRUE) # \\dontrun{} # It is also useful to consider how concentrations vary by # considering two different periods e.g. in intervention # analysis. In the following plot NO2 has clearly increased but much # less so at weekends - perhaps suggesting vehicles other than cars # are important because flows of cars are approximately invariant by # day of the week if (FALSE) { # \\dontrun{ mydata <- splitByDate(mydata, dates= \"1/1/2003\", labels = c(\"before Jan. 2003\", \"After Jan. 2003\")) timeVariation(mydata, pollutant = \"no2\", group = \"split.by\", difference = TRUE) } # } ## sub plots can be extracted from the openair object if (FALSE) { # \\dontrun{ myplot <- timeVariation(mydata, pollutant = \"no2\") plot(myplot, subset = \"day.hour\") # top weekday and plot } # } ## individual plots ## plot(myplot, subset=\"day.hour\") for the weekday and hours subplot (top) ## plot(myplot, subset=\"hour\") for the diurnal plot ## plot(myplot, subset=\"day\") for the weekday plot ## plot(myplot, subset=\"month\") for the monthly plot ## numerical results (mean, lower/upper uncertainties) ## myplot$data$day.hour # the weekday and hour data set ## summary(myplot, subset = \"hour\") #summary of hour data set ## head(myplot, subset = \"day\") #head/top of day data set ## tail(myplot, subset = \"month\") #tail/top of month data set ## plot quantiles and median if (FALSE) { # \\dontrun{ timeVariation(mydata, stati=\"median\", poll=\"pm10\", col = \"firebrick\") ## with different intervals timeVariation(mydata, stati=\"median\", poll=\"pm10\", conf.int = c(0.75, 0.99), col = \"firebrick\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate clusters for back trajectories — trajCluster","title":"Calculate clusters for back trajectories — trajCluster","text":"function carries cluster analysis HYSPLIT back trajectories. function specifically designed work trajectories imported using openair importTraj function, provides pre-calculated back trajectories specific receptor locations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate clusters for back trajectories — trajCluster","text":"","code":"trajCluster( traj, method = \"Euclid\", n.cluster = 5, type = \"default\", cols = \"Set1\", split.after = FALSE, map.fill = TRUE, map.cols = \"grey40\", map.alpha = 0.4, projection = \"lambert\", parameters = c(51, 51), orientation = c(90, 0, 0), by.type = FALSE, origin = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate clusters for back trajectories — trajCluster","text":"traj openair trajectory data frame resulting use importTraj. method Method used calculate distance matrix back trajectories. two methods available: “Euclid” “Angle”. n.cluster Number clusters calculate. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. Note cluster calculations separately made level \"type\". cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") split.type “default” e.g. “season”, trajectories can either calculated level type independently extracted cluster calculations applied whole data set. map.fill base map filled polygon? Default fill countries. map.cols map.fill = TRUE map.cols controls fill colour. Examples include map.fill = \"grey40\" map.fill = openColours(\"default\", 10). latter colours countries can help differentiate . map.alpha transparency level filled map takes values 0 (full transparency) 1 (full opacity). Setting 1 can help view trajectories, trajectory surfaces etc. filled base map. projection map projection used. Different map projections possible mapproj package. See ?mapproject extensive details information setting parameters orientation (see ). parameters mapproj package. Optional numeric vector parameters use projection argument. argument optional sense certain projections require additional parameters. projection require additional parameters set null .e. parameters = NULL. orientation mapproj package. optional vector c(latitude, longitude, rotation) describes \"North Pole\" computing projection. Normally c(90, 0), appropriate cylindrical conic projections. planar projection, set desired point tangency. third value clockwise rotation (degrees), defaults midrange longitude coordinates map. .type percentage total number trajectories given data default. Setting .type = TRUE make panel add 100. origin true filled circle dot shown mark receptor point. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:levelplot cutData. Similarly, common axis title labelling options (xlab, ylab, main) passed levelplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate clusters for back trajectories — trajCluster","text":"openair object. data component contains traj (original data appended cluster) results (average trajectory path per cluster, shown trajCluster() plot.)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate clusters for back trajectories — trajCluster","text":"Two main methods available cluster back trajectories using two different calculations distance matrix. default use standard Euclidian distance pair trajectories. Also available angle-based distance matrix based Sirois Bottenheim (1995). latter method useful interest direction trajectories clustering. distance matrix calculations made C++ speed. data sets 1 year methods relatively fast, although method = \"Angle\" tend take much longer calculate. details methods given openair manual.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate clusters for back trajectories — trajCluster","text":"Sirois, . Bottenheim, J.W., 1995. Use backward trajectories interpret 5-year record PAN O3 ambient air concentrations Kejimkujik National Park, Nova Scotia. Journal Geophysical Research, 100: 2867-2881.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate clusters for back trajectories — trajCluster","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajCluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate clusters for back trajectories — trajCluster","text":"","code":"if (FALSE) { # \\dontrun{ ## import trajectories traj <- importTraj(site = \"london\", year = 2009) ## calculate clusters clust <- trajCluster(traj, n.cluster = 5) head(clust$data) ## note new variable 'cluster' ## use different distance matrix calculation, and calculate by season traj <- trajCluster(traj, method = \"Angle\", type = \"season\", n.cluster = 4) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":null,"dir":"Reference","previous_headings":"","what":"Trajectory level plots with conditioning — trajLevel","title":"Trajectory level plots with conditioning — trajLevel","text":"function plots gridded back trajectories. function requires data imported using importTraj() function.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trajectory level plots with conditioning — trajLevel","text":"","code":"trajLevel( mydata, lon = \"lon\", lat = \"lat\", pollutant = \"height\", type = \"default\", smooth = FALSE, statistic = \"frequency\", percentile = 90, map = TRUE, lon.inc = 1, lat.inc = 1, min.bin = 1, .combine = NA, sigma = 1.5, map.fill = TRUE, map.res = \"default\", map.cols = \"grey40\", map.alpha = 0.3, projection = \"lambert\", parameters = c(51, 51), orientation = c(90, 0, 0), grid.col = \"deepskyblue\", origin = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trajectory level plots with conditioning — trajLevel","text":"mydata Data frame, result importing trajectory file using importTraj. lon Column containing longitude, decimal. lat Column containing latitude, decimal. pollutant Pollutant plotted. default trajectory height used. type type determines data split, .e., conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. \"season\", \"year\", \"weekday\" . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. smooth trajectory surface smoothed? statistic Statistic use trajLevel(). default, function plot trajectory frequencies (statistic = \"frequency\"). alternative way viewing trajectory frequencies, argument method = \"hexbin\" can used. case hexagonal binning trajectory points (.e., point every three hours along back trajectory). plot shows trajectory frequencies uses hexagonal binning. also various ways plotting concentrations. possible set statistic = \"difference\". case trajectories associated concentration greater percentile compared full set trajectories understand differences frequencies origin air masses. comparison made comparing percentage change gridded frequencies. example, plot show top 10\\ tend originate air-mass origins east. statistic = \"pscf\" Potential Source Contribution Function map produced. statistic method interacts percentile. statistic = \"cwt\" concentration weighted trajectories plotted. statistic = \"sqtba\" Simplified Quantitative Transport Bias Analysis undertaken. statistic method interacts .combine sigma. percentile percentile concentration pollutant trajectories compared. map base map drawn? TRUE world base map maps package used. lon.inc, lat.inc longitude latitude intervals used binning data. min.bin minimum number unique points grid cell. Counts min.bin set missing. .combine statistic \"SQTBA\" possible combine lots receptor locations derive single map. .combine identifies column differentiates different sites (commonly column named \"site\"). Note individual site maps normalised first dividing mean value. sigma SQTBA approach sigma determines amount back trajectory spread based Gaussian plume equation. Values literature suggest 5.4 km one hour. However, testing suggests lower values reveal source regions effectively introducing much noise. map.fill base map filled polygon? Default fill countries. map.res resolution base map. default function uses ‘world’ map maps package. map.res = \"hires\" (much) detailed base map ‘worldHires’ mapdata package used. Use library(mapdata). Also available map showing US states. case map.res = \"state\" used. map.cols map.fill = TRUE map.cols controls fill colour. Examples include map.fill = \"grey40\" map.fill = openColours(\"default\", 10). latter colours countries can help differentiate . map.alpha transparency level filled map takes values 0 (full transparency) 1 (full opacity). Setting 1 can help view trajectories, trajectory surfaces etc. filled base map. projection map projection used. Different map projections possible mapproj package. See ?mapproject extensive details information setting parameters orientation (see ). parameters mapproj package. Optional numeric vector parameters use projection argument. argument optional sense certain projections require additional parameters. projection require additional parameters set null .e. parameters = NULL. orientation mapproj package. optional vector c(latitude, longitude, rotation) describes \"North Pole\" computing projection. Normally c(90, 0), appropriate cylindrical conic projections. planar projection, set desired point tangency. third value clockwise rotation (degrees), defaults midrange longitude coordinates map. grid.col colour map grid used. remove grid set grid.col = \"transparent\". origin true filled circle dot shown mark receptor point. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... arguments passed cutData() scatterPlot(). provides access arguments used functions functions turn pass arguments . example, trajLevel() passes argument cex scatterPlot() turn passes lattice::xyplot() applied set plot symbol size.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trajectory level plots with conditioning — trajLevel","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trajectory level plots with conditioning — trajLevel","text":"alternative way showing trajectories compared plotting trajectory lines bin points latitude/longitude intervals. purposes trajLevel() used. several trajectory statistics can plotted gridded surfaces. First, statistic can set \"frequency\" show number back trajectory points grid square. Grid squares default 1 degree intervals, controlled lat.inc lon.inc. plots useful showing frequency air mass locations. Note also possible set method = \"hexbin\" plotting frequencies (concentrations), produce plot hexagonal binning. statistic = \"difference\" trajectories associated concentration greater percentile compared full set trajectories understand differences frequencies origin air masses highest concentration trajectories compared trajectories average. comparison made comparing percentage change gridded frequencies. example, plot show top 10\\ east. statistic = \"pscf\" Potential Source Contribution Function plotted. PSCF calculates probability source located latitude \\(\\) longitude \\(j\\) (Pekney et al., 2006).basis PSCF source located (,j), air parcel back trajectory passing location indicates material source can collected transported along trajectory receptor site. PSCF solves $$PSCF = m_{ij}/n_{ij}$$ \\(n_{ij}\\) number times trajectories passed cell (,j) \\(m_{ij}\\) number times source concentration high trajectories passed cell (,j). criterion determining \\(m_{ij}\\) controlled percentile, default 90. Note also cells data weighting factor applied reduce effect. limitation PSCF method grid cells can PSCF value sample concentrations either slightly higher much higher criterion. result, can difficult distinguish moderate sources strong ones. Seibert et al. (1994) computed concentration fields identify source areas pollutants. Concentration Weighted Trajectory (CWT) approach considers concentration species together residence time grid cell. CWT approach shown yield similar results PSCF approach. openair manual details examples approaches. useful refinement smooth resulting surface, possible setting smooth = TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Trajectory level plots with conditioning — trajLevel","text":"function active development likely change","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Trajectory level plots with conditioning — trajLevel","text":"Pekney, N. J., Davidson, C. ., Zhou, L., & Hopke, P. K. (2006). Application PSCF CPF PMF-Modeled Sources PM 2.5 Pittsburgh. Aerosol Science Technology, 40(10), 952-961. Seibert, P., Kromp-Kolb, H., Baltensperger, U., Jost, D., 1994. Trajectory analysis high-alpine air pollution data. NATO Challenges Modern Society 18, 595-595. Xie, Y., & Berkowitz, C. M. (2007). use conditional probability functions potential source contribution functions identify source regions advection pathways hydrocarbon emissions Houston, Texas. Atmospheric Environment, 41(28), 5831-5847.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Trajectory level plots with conditioning — trajLevel","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajLevel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trajectory level plots with conditioning — trajLevel","text":"","code":"# show a simple case with no pollutant i.e. just the trajectories # let's check to see where the trajectories were coming from when # Heathrow Airport was closed due to the Icelandic volcanic eruption # 15--21 April 2010. # import trajectories for London and plot if (FALSE) { # \\dontrun{ lond <- importTraj(\"london\", 2010) } # } # more examples to follow linking with concentration measurements... # import some measurements from KC1 - London if (FALSE) { # \\dontrun{ kc1 <- importAURN(\"kc1\", year = 2010) # now merge with trajectory data by 'date' lond <- merge(lond, kc1, by = \"date\") # trajectory plot, no smoothing - and limit lat/lon area of interest # use PSCF trajLevel(subset(lond, lat > 40 & lat < 70 & lon > -20 & lon < 20), pollutant = \"pm10\", statistic = \"pscf\" ) # can smooth surface, suing CWT approach: trajLevel(subset(lond, lat > 40 & lat < 70 & lon > -20 & lon < 20), pollutant = \"pm2.5\", statistic = \"cwt\", smooth = TRUE ) # plot by season: trajLevel(subset(lond, lat > 40 & lat < 70 & lon > -20 & lon < 20), pollutant = \"pm2.5\", statistic = \"pscf\", type = \"season\" ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Trajectory line plots with conditioning — trajPlot","title":"Trajectory line plots with conditioning — trajPlot","text":"function plots back trajectories. function requires data imported using importTraj function.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trajectory line plots with conditioning — trajPlot","text":"","code":"trajPlot( mydata, lon = \"lon\", lat = \"lat\", pollutant = \"height\", type = \"default\", map = TRUE, group = NA, map.fill = TRUE, map.res = \"default\", map.cols = \"grey40\", map.alpha = 0.4, projection = \"lambert\", parameters = c(51, 51), orientation = c(90, 0, 0), grid.col = \"deepskyblue\", npoints = 12, origin = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trajectory line plots with conditioning — trajPlot","text":"mydata Data frame, result importing trajectory file using importTraj. lon Column containing longitude, decimal. lat Column containing latitude, decimal. pollutant Pollutant plotted. default trajectory height used. type type determines data split, .e., conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. \"season\", \"year\", \"weekday\" . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. map base map drawn? TRUE world base map maps package used. group sometimes useful group colour trajectories according grouping variable. See example . map.fill base map filled polygon? Default fill countries. map.res resolution base map. default function uses ‘world’ map maps package. map.res = \"hires\" (much) detailed base map ‘worldHires’ mapdata package used. Use library(mapdata). Also available map showing US states. case map.res = \"state\" used. map.cols map.fill = TRUE map.cols controls fill colour. Examples include map.fill = \"grey40\" map.fill = openColours(\"default\", 10). latter colours countries can help differentiate . map.alpha transparency level filled map takes values 0 (full transparency) 1 (full opacity). Setting 1 can help view trajectories, trajectory surfaces etc. filled base map. projection map projection used. Different map projections possible mapproj package. See ?mapproject extensive details information setting parameters orientation (see ). parameters mapproj package. Optional numeric vector parameters use projection argument. argument optional sense certain projections require additional parameters. projection require additional parameters set null .e. parameters = NULL. orientation mapproj package. optional vector c(latitude, longitude, rotation) describes \"North Pole\" computing projection. Normally c(90, 0), appropriate cylindrical conic projections. planar projection, set desired point tangency. third value clockwise rotation (degrees), defaults midrange longitude coordinates map. grid.col colour map grid used. remove grid set grid.col = \"transparent\". npoints dot placed every npoints along full trajectory. hourly back trajectories points plotted every npoint hours. helps understand air masses particular times get feel speed air (points closer together correspond slower moving air masses). npoints = NA points added. origin true filled circle dot shown mark receptor point. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... arguments passed cutData scatterPlot. provides access arguments used functions functions turn pass arguments . example, plotTraj passes argument cex scatterPlot turn passes lattice function xyplot applied set plot symbol size.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trajectory line plots with conditioning — trajPlot","text":"Several types trajectory plot available. trajPlot default plot lat/lon location showing origin trajectory, pollutant supplied. pollutant given, merging trajectory data concentration data (see example ), trajectories colour-coded concentration pollutant. long time series can lots overplotting making difficult gauge overall concentration pattern. cases setting alpha low value e.g. 0.1 can help. user can also show points instead lines plot.type = \"p\". Note trajPlot plot full length trajectories. remembered selecting part year plot.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Trajectory line plots with conditioning — trajPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trajPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trajectory line plots with conditioning — trajPlot","text":"","code":"# show a simple case with no pollutant i.e. just the trajectories # let's check to see where the trajectories were coming from when # Heathrow Airport was closed due to the Icelandic volcanic eruption # 15--21 April 2010. # import trajectories for London and plot if (FALSE) { # \\dontrun{ lond <- importTraj(\"london\", 2010) # well, HYSPLIT seems to think there certainly were conditions where trajectories # orginated from Iceland... trajPlot(selectByDate(lond, start = \"15/4/2010\", end = \"21/4/2010\"))} # } # plot by day, need a column that makes a date if (FALSE) { # \\dontrun{ lond$day <- as.Date(lond$date) trajPlot(selectByDate(lond, start = \"15/4/2010\", end = \"21/4/2010\"), type = \"day\") } # } # or show each day grouped by colour, with some other options set if (FALSE) { # \\dontrun{ trajPlot(selectByDate(lond, start = \"15/4/2010\", end = \"21/4/2010\"), group = \"day\", col = \"turbo\", lwd = 2, key.pos = \"right\", key.col = 1) } # } # more examples to follow linking with concentration measurements..."},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot heat map trends — trendLevel","title":"Plot heat map trends — trendLevel","text":"trendLevel function provides way rapidly showing large amount data condensed form. one plot, variation concentration one pollutant can shown function three categorical properties. default version plot uses y = hour day, x = month year type = year provide information trends, seasonal effects diurnal variations. However, x, y type summarising statistics can modified provide range similar plots.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot heat map trends — trendLevel","text":"","code":"trendLevel( mydata, pollutant = \"nox\", x = \"month\", y = \"hour\", type = \"year\", rotate.axis = c(90, 0), n.levels = c(10, 10, 4), limits = c(0, 100), cols = \"default\", auto.text = TRUE, key.header = \"use.stat.name\", key.footer = pollutant, key.position = \"right\", key = TRUE, labels = NA, breaks = NA, statistic = c(\"mean\", \"max\", \"frequency\"), stat.args = NULL, stat.safe.mode = TRUE, drop.unused.types = TRUE, col.na = \"white\", plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot heat map trends — trendLevel","text":"mydata openair data frame use generate trendLevel plot. pollutant name data series mydata sample produce trendLevel plot. x name data series use trendLevel x-axis. used y type options bin data applying statistic (see ). data series mydata can also used. (Note: trendLevel allow duplication x, y type options within call.) y names data series use trendLevel y-axis additional conditioning, respectively. x . type See y. rotate.axis rotation applied trendLevel x y axes. default, c(90, 0), rotates x axis 90 degrees rotate y axis. (Note: one value supplied, applied axes; two values supplied, first two used.) n.levels number levels split x, y type data numeric. default, c(10, 10, 4), cuts numeric x y data ten levels numeric type data four levels. (Notes: option ignored date conditioning factors. less three values supplied, three values determined recursion; three values supplied, first three used.) limits colour scale range use generating trendLevel plot. cols colour set use colour trendLevel surface. cols passed openColours evaluation. See ?openColours details. auto.text Automatic routine text formatting. auto.text = TRUE passes common lattice labelling terms (e.g. xlab x-axis, ylab y-axis main title) plot via quickText provide common text formatting. alternative auto.text = FALSE turns option passes supplied labels plot without modification. key.header, key.footer Adds additional text labels /scale key, respectively. example, passing options key.header = \"\", key.footer = c(\"mean\",\"nox\") adds addition text scale footer. enabled (auto.text = TRUE), arguments passed scale key (drawOpenKey) via quickText handle formatting. term \"get.stat.name\", used default key.header setting, reserved automatically adds statistic function names defaults \"level\" unnamed functions requested via statistic. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. key Fine control scale key via drawOpenKey. See ?drawOpenKey details. labels categorical colour scale required labels used. Note one less label break. example, labels = c(\"good\", \"bad\", \"bad\"). breaks must also supplied labels given. breaks categorical colour scale required breaks used. example, breaks = c(0, 50, 100, 1000). case “good” corresponds values 0 50 . Users set maximum value breaks exceed maximum data value ensure within maximum final range e.g. 100–1000 case. labels must also supplied. statistic statistic method use summarise locally binned pollutant measurements . Three options currently encoded: “mean” (default), “max” “frequency”. (Note: Functions can also sent directly via statistic. However, option still development used caution. See Details .) stat.args Additional options used statistic function. extra options supplied list named parameters. (see Details .) stat.safe.mode addition protection applied using functions directly statistic users can ignore. option returns NA instead running statistic binned subsamples empty. Many common functions terminate error message applied empty dataset. , option provides mechanism work functions. cases, e.g. function counted missing entries, might need set FALSE (see Details .) drop.unused.types Hide unused/empty type conditioning cases. conditioning options may generate empty cases data sets, e.g. hour day measurements taken. Empty x y cases generate 'holes' individual plots. However, empty type cases produce blank panels plotted. Therefore, default, TRUE, excludes empty panels plot. alternative FALSE plots type panels. col.na Colour used show missing data. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... Addition options passed cutData type handling levelplot lattice finer control plot .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot heat map trends — trendLevel","text":"openair object.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot heat map trends — trendLevel","text":"trendLevel allows use third party summarising functions via statistic option. additional function arguments included within function called using statistic supplied list named parameters sent using stat.args. example, encoded option statistic = \"mean\" equivalent statistic = mean, stat.args = list(na.rm = TRUE) R command mean(x, na.rm= TRUE). Many R functions user's code applied similar fashion, subject following restrictions: first argument sent function must data series analysed; name `x' used extra options supplied stat.args; function return required answer numeric NA. Note: supplied function returns one answer, currently first retained used trendLevel. returned information ignored without warning. function terminates error sent empty data series, option stat.safe.mode set FALSE trendLevel may fail. Note: stat.safe.mode = TRUE option returns NA without warning empty data series.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot heat map trends — trendLevel","text":"Karl Ropkins David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/trendLevel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot heat map trends — trendLevel","text":"","code":"#basic use #default statistic = \"mean\" trendLevel(mydata, pollutant = \"nox\") #applying same as 'own' statistic my.mean <- function(x) mean(x, na.rm = TRUE) trendLevel(mydata, pollutant = \"nox\", statistic = my.mean) #alternative for 'third party' statistic #trendLevel(mydata, pollutant = \"nox\", statistic = mean, # stat.args = list(na.rm = TRUE)) if (FALSE) { # \\dontrun{ # example with categorical scale trendLevel(mydata, pollutant = \"no2\", border = \"white\", statistic = \"max\", breaks = c(0, 50, 100, 500), labels = c(\"low\", \"medium\", \"high\"), cols = c(\"forestgreen\", \"yellow\", \"red\")) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":null,"dir":"Reference","previous_headings":"","what":"Traditional wind rose plot — windRose","title":"Traditional wind rose plot — windRose","text":"traditional wind rose plot plots wind speed wind direction different intervals. pollution rose applies plot structure substitutes measurements, commonly pollutant time series, wind speed.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Traditional wind rose plot — windRose","text":"","code":"windRose( mydata, ws = \"ws\", wd = \"wd\", ws2 = NA, wd2 = NA, ws.int = 2, angle = 30, type = \"default\", calm.thresh = 0, bias.corr = TRUE, cols = \"default\", grid.line = NULL, width = 1, seg = NULL, auto.text = TRUE, breaks = 4, offset = 10, normalise = FALSE, max.freq = NULL, paddle = TRUE, key.header = NULL, key.footer = \"(m/s)\", key.position = \"bottom\", key = TRUE, dig.lab = 5, include.lowest = FALSE, statistic = \"prop.count\", pollutant = NULL, annotate = TRUE, angle.scale = 315, border = NA, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Traditional wind rose plot — windRose","text":"mydata data frame containing fields ws wd ws Name column representing wind speed. wd Name column representing wind direction. ws2, wd2 user can supply second set wind speed wind direction values first can compared. See pollutionRose() details. ws.int Wind speed interval. Default 2 m/s low met masts low mean wind speeds value 1 0.5 m/s may better. angle Default angle “spokes” 30. potentially useful angles 45 10. Note width wind speed interval may need adjusting using width. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. calm.thresh default, conditions considered calm wind speed zero. user can set different threshold calms setting calm.thresh higher value. example, calm.thresh = 0.5 identify wind speeds 0.5 calm. bias.corr angle divide exactly 360 bias introduced frequencies wind direction already supplied rounded nearest 10 degrees, often case. example, angle = 22.5, N, E, S, W include 3 wind sectors angles two. bias correction can made correct problem. simple method according Applequist (2012) used adjust frequencies. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet”, “hue” user defined. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\", \"black\"). grid.line Grid line interval use. NULL, default, assigned based available data range. However, can also forced specific value, e.g. grid.line = 10. grid.line can also list control interval, line type colour. example grid.line = list(value = 10, lty = 5, col = \"purple\"). width paddle = TRUE, adjustment factor width wind speed intervals. example, width = 1.5 make paddle width 1.5 times wider. seg paddle = TRUE, seg determines width segments. example, seg = 0.5 produce segments 0.5 * angle. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly, e.g., subscripting ‘2’ NO2. breaks commonly, number break points wind speed. ws.int default 2 m/s, breaks default, 4, generates break points 2, 4, 6, 8 m/s. However, breaks can also used set specific break points. example, argument breaks = c(0, 1, 10, 100) breaks data segments <1, 1-10, 10-100, >100. offset size 'hole' middle plot, expressed percentage polar axis scale, default 10. normalise TRUE wind direction segment normalised equal one. useful showing concentrations (parameters) contribute wind sector proportion time wind direction low. line showing probability wind directions particular wind sector also shown. max.freq Controls scaling used setting maximum value radial limits. useful ensure several plots use radial limits. paddle Either TRUE FALSE. TRUE plots rose using 'paddle' style spokes. FALSE plots rose using 'wedge' style spokes. key.header Adds additional text/labels scale key. example, passing windRose(mydata, key.header = \"ws\") adds addition text scale header. Note: argument passed drawOpenKey() via quickText(), applying auto.text argument, handle formatting. key.footer Adds additional text/labels scale key. See key.header information. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. key Fine control scale key via drawOpenKey(). dig.lab number significant figures scientific number formatting used break point key labelling. Default 5. include.lowest Logical. FALSE (default), first interval left exclusive right inclusive. TRUE, first interval left right inclusive. Passed include.lowest argument cut(). statistic statistic applied data bin plot. Options currently include “prop.count”, “prop.mean” “abs.count”. default “prop.count” sizes bins according proportion frequency measurements. Similarly, “prop.mean” sizes bins according relative contribution mean. “abs.count” provides absolute count measurements bin. pollutant Alternative data series sampled instead wind speed. windRose() default NULL equivalent pollutant = \"ws\". Use pollutionRose(). annotate TRUE percentage calm mean values printed panel together description statistic plot. \" \" statistic plot. Custom annotations may added setting value c(\"annotation 1\", \"annotation 2\"). angle.scale scale default shown 315 degree angle. Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale another value (0 360 degrees) mitigate problems. example angle.scale = 45 draw scale heading NE direction. border Border colour shaded areas. Default border. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... parameters passed drawOpenKey, lattice:xyplot cutData. Axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Traditional wind rose plot — windRose","text":"openair object. Summarised proportions can extracted directly using $data operator, e.g. object$data output <- windRose(mydata). returns data frame three set columns: cond, conditioning based type; wd, wind direction; calm, statistic proportion data unattributed specific wind direction collected calm conditions; several (one range binned plot) columns giving proportions measurements associated ws pollutant range plotted discrete panel.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Traditional wind rose plot — windRose","text":"windRose data summarised direction, typically 45 30 (10) degrees different wind speed categories. Typically, wind speeds represented different width \"paddles\". plots show proportion (represented percentage) time wind certain angle wind speed range. default windRose plot windRose using \"paddle\" style segments placing scale key plot. argument pollutant uses plotting structure substitutes another data series, defined pollutant, wind speed. recommended use pollutionRose() plotting pollutant concentrations. option statistic = \"prop.mean\" provides measure relative contribution bin panel mean, intended use pollutionRose.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Traditional wind rose plot — windRose","text":"windRose pollutionRose use drawOpenKey() produce scale keys.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Traditional wind rose plot — windRose","text":"Applequist, S, 2012: Wind Rose Bias Correction. J. Appl. Meteor. Climatol., 51, 1305-1309. Droppo, J.G. B.. Napier (2008) Wind Direction Bias Generating Wind Roses Conducting Sector-Based Air Dispersion Modeling, Journal Air & Waste Management Association, 58:7, 913-918.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Traditional wind rose plot — windRose","text":"David Carslaw (additional contributions Karl Ropkins)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/windRose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Traditional wind rose plot — windRose","text":"","code":"# basic plot windRose(mydata) # one windRose for each year windRose(mydata,type = \"year\") # windRose in 10 degree intervals with gridlines and width adjusted if (FALSE) { # \\dontrun{ windRose(mydata, angle = 10, width = 0.2, grid.line = 1) } # }"},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New Features","title":"openair (development version)","text":"add calm.thresh option windRose. change allows users set non-zero wind speed threshold considered calm. Added new features openColours(): Added new qualitative colour palettes: “tol” family colour-blind friendly palettes based work Paul Tol (https://personal.sron.nl/~pault/), “tableau” “observable” provide access “Tableau10” “Observable10” palettes aid consistency plots made platforms. n isn’t defined qualitative palette (e.g., “Dark2”), full qualitative palette returned. Previously errored default 100. openColours() now check whether provided scheme either known scheme name vector valid R colours, provide informative error case.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"bug-fixes-development-version","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"openair (development version)","text":"Fixed issue wherein importUKAQ() drop sites importing local sites another network.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-218-2","dir":"Changelog","previous_headings":"","what":"openair 2.18-2","title":"openair 2.18-2","text":"CRAN release: 2024-03-11","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"new-features-2-18-2","dir":"Changelog","previous_headings":"","what":"New Features","title":"openair 2.18-2","text":"add option corPlot carry “use” option cor.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"bug-fixes-2-18-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"openair 2.18-2","text":"fix date formatting issue aqStats(). fix wrong formula Euclidian distances trajCluster() transform coordinates distance matrix calculated. Thanks Dan Jaffe. “15_min” can used data_type importUKAQ() family. importUKAQ() can now used import annual, monthly, DAQI statistics multiple combinations source year.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-218-0","dir":"Changelog","previous_headings":"","what":"openair 2.18-0","title":"openair 2.18-0","text":"CRAN release: 2023-10-09","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"new-features-2-18-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"openair 2.18-0","text":"added new importUKAQ() function, supersedes importAURN(), importAQE(), importWAQN(), importSAQN(), importNI() importLocal(). importUKAQ() brings lot new functionality accessing UK air quality data openair. importUKAQ() arguments functions supersedes, well “source” define specific network interest. “source” argument can either length 1 equal length “site” argument. means importUKAQ() can import statistics multiple different networks . importUKAQ() allows ratified = TRUE to_narrow = TRUE simultaneously. return tibble two columns per observation - “value” containing concentration “qc” containing TRUE/FALSE indicates whether concentration validated. AQE, WAQN, SAQN NI networks now allow data_type = \"daqi\". time writing, data 2022 present. site pollutant arguments importUKAQ() respected data_type “daqi”, “annual” “monthly”. default behaviour return available statistics changed. (#346) various arguments augment import function outputs now behave consistently one another. example, ratified now respects pollutant returns “_qc” columns pollutants interest. importAURN(), importAQE(), importWAQN(), importSAQN(), importNI() importLocal() still exported openair. simply wrappers around importUKAQ() forced “source” arguments, remain back-compatibility convenience. importKCL() also imports UK air quality data, currently made available importUKAQ(). Users continue import KCL data via importKCL() time . importMeta() gained two new “source” options assist new importUKAQ() function: source = \"ukaq\" return metadata “UKAQ” networks. source = \"\" return available metadata (including KCL Europe). new function runRegression() extracting ‘dilution lines’ air quality data. Online manual updated principles examples. calendarPlot() now automatically creates labels breaks specified. example, c(0, 10, 20) create labels c(\"0 - 10\", \"10 - 20\"). labels can still used override default values. (#341) Added w.abbr.len argument calendarPlot() controls length weekday abbreviation. requested help people using written Chinese, broadly useful (e.g., use “Mon”, “Tue”, “Wed” place “M”, “T”, “W”). (#101) return tibble timeAverage(). add option panel.gap leave space panels timeAverage day-hour plots. Set 0 previous behaviour. Move regression formula main plot polarPlot() clarity label slope ‘m’. Tweak seasonal trend decomposition using STL allow seasonal amplitude vary . Affects smoothTrend() TheilSen(). Added colours recommended UK Government Analysis Function (https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours--charts/) openColours(). polarCluster now prints cluster contributions returns data frame output.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"bug-fixes-2-18-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"openair 2.18-0","text":"order columns importUKAQ() remain consistent (metadata, date, pollutants, meteo) regardless whether hc TRUE FALSE. quickText() now automatically capitalise “” “”. (#343) year argument importMeta() now respected source = \"kcl\" \"europe\". Several directional analysis plot family (e.g., polarFreq()) refactored use .null() .na() missing(). predominantly internal change, make functions easier use inside functions (e.g., function(data, breaks = NA) polarFreq(data, breaks = breaks)) now run successfully). calendarPlot annotated ws wd arrows, use max ws/wd corresponds hour maximum pollutant concentration simple max ws/wd day. summaryPlot() longer forces time zones GMT. (#356)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-217-0","dir":"Changelog","previous_headings":"","what":"openair 2.17-0","title":"openair 2.17-0","text":"CRAN release: 2023-05-02","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"new-features-2-17-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"openair 2.17-0","text":"add option meteo importAURN() family functions. default modelled wind speed, direction ambient temperature returned available, meteo = FALSE. added new column modStats(), “P”, represents P-value correlation reported cor.test(). update processing ADMS meteorological (.MOP) files return stability tidier data. refined output pollutionRose() ws2 wd2 options provided; instead misleading N/E/S/W, markers become 0, +90, +/-180, -90. timeAverage() progress bar now powered cli/purrr can silenced using new progress argument. polarCluster() progress bar now also powered cli/purrr. colours corresponding UK daily air quality index (https://uk-air.defra.gov.uk/air-pollution/daqi) added options openColours(). openair object’s data property returned trajLevel() function now consistently formatted regardless statistic choice, contains relevant statistic-specific information (e.g., sigma \"SQTBA\").","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"bug-fixes-2-17-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"openair 2.17-0","text":"fixed issue modStats() “method” can now changed (e.g., “spearman”). fixed issue aqStats() output wasn’t properly split pollutant/type. fixed issue conditionalQuantile() plot fail produced “type” specified. fixed issue cutData() “season” wouldn’t respect system locale (e.g., still show “(DJF)” Italian systems, instead correct “(gla)”). Note season name (e.g., “Winter”) automatically converted. fixed theilSen() silent argument. message “taking bootstrap samples. please wait” also now sent via message() rather print() appears per function call. fixed issue trajCluster() proportions overlap clustering forward trajectories. Proportions now appear end cluster paths, regardless whether trajectory back forward. fixed issue openair plotting functions properly return openair S3 object, data objects tibbles. Fixed issue timeAverage() date formatting caused problems, possibly due latest version R (4.3.0).","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-215","dir":"Changelog","previous_headings":"","what":"openair 2.15","title":"openair 2.15","text":"CRAN release: 2023-02-06 use native pipe yet - work old versions R fix issue polarDiff() resulting openair object contain plot element.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-214","dir":"Changelog","previous_headings":"","what":"openair 2.14","title":"openair 2.14","text":"CRAN release: 2023-01-25 add year option importMeta. allows user select sites open point chosen year duration years. make sure full daily gravimetric data returned PM10 PM2.5 available using importAURN family functions. data returned gr_pm2.5 gr_pm10 data_type = \"daily\" add alpha argument polar directional analysis functions. mainly use openairmaps may general interest specific use cases. fix small bug smoothTrend returned fit data data missing.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-213","dir":"Changelog","previous_headings":"","what":"openair 2.13","title":"openair 2.13","text":"CRAN release: 2023-01-06 add importLocal access locally-managed automatic monitoring data fix bug pollutionRose single number breaks given (ignored) remove legacy functions import, import.2, importAURNcsv kernelExceed","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-211","dir":"Changelog","previous_headings":"","what":"openair 2.11","title":"openair 2.11","text":"CRAN release: 2022-09-25 add sigma options SQTBA trajectory analysis control plume spread assumptions; set 1.5 km (one hour) fix bug introduced timeAverage multi-time period averages fix bug timeProp simplify code","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-210","dir":"Changelog","previous_headings":"","what":"openair 2.10","title":"openair 2.10","text":"add Daily Air Quality Index (DAQI) importAURN data_type. add rolling 8 24 hour statistics importAURN family data_type. use https importing meta data importMeta fix calendarPlot issue gaps selected months e.g.month = c(1, 2, 12) fix warning message calendarPlot don’t pad missing dates timeAverage DST deprecate resolution polarPlot — now uses predictions coarser resolution interpolated. also speed-plotting add new source method trajectory analysis (trajlevel), SQTBA — Simplified Quantitative Transport Bias Analysis fix bivariate Gaussian function polarPlot two pollutants supplied different statistics add initial version ‘York regression’ approach option polarPlot. regression approach determines best fit line error ‘x’ ‘y’. openair book updated cover detail.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-29-1","dir":"Changelog","previous_headings":"","what":"openair 2.9-1","title":"openair 2.9-1","text":"CRAN release: 2022-03-30 return hydrocarbon measurements default annual monthly summaries importAURN. fix issue class date-time object importing air quality data e.g. importAURN. refine default grid lines windRose pollutionRose.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-29-0","dir":"Changelog","previous_headings":"","what":"openair 2.9-0","title":"openair 2.9-0","text":"CRAN release: 2022-03-22 add option TaylorDiagram annotation observed data. fix issue timevariation difference = TRUE fix trajCluster issue dplyr access time-averaged air quality data using importAURN, importSAQN, importWAQN, importAQE importNI. New option data_type, can “hourly” (default), “annual”, “monthly”, “daily” “15min” (SO2). new data sources make much easier work long-term time series many sites. See openair manual details. fix terrible spelling selectRunning.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-28-6","dir":"Changelog","previous_headings":"","what":"openair 2.8-6","title":"openair 2.8-6","text":"CRAN release: 2021-11-22 fix annotation bug comparing two data sets windRose enhance selectRunning. Now returns full data frame new condition column. make sure “hemisphere” argument goes type “monthyear” “yearmonth” argument month passed calendarPlot","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-28-4","dir":"Changelog","previous_headings":"","what":"openair 2.8-4","title":"openair 2.8-4","text":"CRAN release: 2021-09-15 fix bug windRose whole period calm add optimisation polarCluster speed clustering option pamonce = 3. appreciably affect results. fix strange bug aqStats due lubridate time zone issue. fix bug TaylorDiagram group present. convert times Daylight Saving Time checking data — just report presence. add option plot.type summaryPlot change line style; useful vertical lines time series plot.type = \"h\"","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4","dir":"Changelog","previous_headings":"","what":"openair 2.8-1","title":"openair 2.8-4","text":"Fix bug crept polarCluster","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-1","dir":"Changelog","previous_headings":"","what":"openair 2.8-0","title":"openair 2.8-4","text":"New function polarDiff consider difference surface two polar plots. Modify polarCluster consider clustering differences polar plot surfaces. Fix user annotation windRose pass option number significant figures used annotate plots (dig.lab)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-2","dir":"Changelog","previous_headings":"","what":"openair 2.7-6","title":"openair 2.8-4","text":"fix bug percentileRose statistic = \"cpf\" multiple pollutants fix bug timeAverage type = \"season\" avg.time = \"season\" add week openair default types fix bug timeVariation considering difference plots missing data fix CRAN check using return","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-3","dir":"Changelog","previous_headings":"","what":"openair 2.7-4","title":"openair 2.8-4","text":"add ambient temperature (air_temp) meteorological variables returned importAURN, importSAQN importWAQN (using WRF model). re-format date returned importAQE due strange dplyr join issues add statistic = \"Spearman\" polarPlot option considering two pollutants. add method option corPlot allow different correlation methods (“pearson”, “spearman” “kendall”) re-factor UK air quality data import functions .e. importAURN, importSAQN, importWAQN, importAQE. Add importNI import data Northern Ireland. Add option UK air quality import functions return information whether individual pollutants quality-assured using option ratified. functions include importAURN, importSAQN, importWAQN, importAQE importNI Clean returned importMeta Return air quality data site name code character rather factor","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-4","dir":"Changelog","previous_headings":"","what":"openair 2.7-2","title":"openair 2.8-4","text":"fix tibble recycling issue fix shading issue lowest percentile range percentileRose. fix strange bug importWAQN intermittently fail; sometimes crashing R. add option date.format TheilSen.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-5","dir":"Changelog","previous_headings":"","what":"openair 2.7-0","title":"openair 2.8-4","text":"fix calendarPlot slowness MacOS Refine use Gaussian kernels two pollutant statistics considered polarPlot Add option statistic = \"nwr\" polarPlot implements Non-parametric Wind Regression based Henry et al. (2009). openair implementation identical yield similar results. NEW importAQE function import data Air Quality England sites. NEW importEurope provide access data saqgetr package.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-6","dir":"Changelog","previous_headings":"","what":"openair 2.6-6","title":"openair 2.8-4","text":"fix bug TheilSen missing data deseason = TRUE fix bug timeAverage interval padding dates date “Date” class “POSIXct” fix example trajCluster, n.cluster n.clusters fix issue DST cutData allow ‘hemisphere’ supplied argument timeAverage, used avg.time = “season”. add option to_narrow importAURN, importSAQN, importKCL importWAQN stack data tidy format. data now returned ‘tibble’ Allow meta data returned importSAQN importWAQN.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-7","dir":"Changelog","previous_headings":"","what":"openair 2.6-4","title":"openair 2.8-4","text":"fix issue TheilSen conditioning < 6 annual measurements remove arrow heads polarPlot axes. Use Kalman filter Kalman smooth impute missing monthly means deseason = TRUE smoothTrend TheilSen. replaces simple linear interpolation. fix bug smoothTrend ci = FALSE (smooth fitted). Add importWAQN access data Welsh air quality network. Add “waqn” data source importMeta.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-8","dir":"Changelog","previous_headings":"","what":"openair 2.6-1","title":"openair 2.8-4","text":"Update handling meta data importMeta.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-9","dir":"Changelog","previous_headings":"","what":"openair 2.6-0","title":"openair 2.8-4","text":"aqStats use default data.thresh = 0 rather 75% ensure summaries calculated Fix confidence intervals timeVariation statistic - “median”. Revision result narrower range. Change default corPlot plot lower upper triangles; add lower option. Update meta data Scottish Air Quality Network (“saqn”); badly date fix bug timeAverage interval one time unit e.g. “10 day”","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-10","dir":"Changelog","previous_headings":"","what":"openair 2.5-0","title":"openair 2.8-4","text":"add simple versions viridis colour palettes: “viridis”, “plasma”, “magma”, “inferno” “cividis” e.g. polarPlot(mydata, cols = \"plasma\") allow option align used aqStats determine rolling means calculated. Can take values “centre” (default), “left” “right”. make sure full year present importAURN fix issue multiple pollutants polarAnnulus fix issues trajectory functions due dplyr.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-11","dir":"Changelog","previous_headings":"","what":"openair 2.4-0","title":"openair 2.8-4","text":"use lubridate timeAverage improve speed / simplicity make sure strip colours white openair objects fix bug polarPlot statistic = \"cpf\" using tibbles fix bug polarCluster exported data (date correctly merged produce single date column) convert internal mydata ‘tibble’ easier printing. allow npoints = NA trajPlot suppress plotting interval points. fix bias correction bug windRose ws/wd different names fix bug timeAverage wind direction (wd) statistic = \"data.cap\" New built-colour palette colour blind “cbPalette”. Note maximum number colours 8 e.g. windRose(mydata, col = \"cbPalette\", breaks = 6). Thanks Jerry Martin.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-2-8-4-12","dir":"Changelog","previous_headings":"","what":"openair 2.3-0","title":"openair 2.8-4","text":"add option plot TheilSen. FALSE can useful analysing data extract trend components plot ways TheilSen plot required. add option silent TheilSen avoid printing updates trend fitting. default FALSE. fix wrong ordering names timeVariation one pollutant fix date parsing issues selectByDate. fix wrong ordering timePlot allow calendarPlot span time period. function can now straddle parts two years several years. add option col.arrow calendarPlot control colour wind speed / direction annotation arrows.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-22-3","dir":"Changelog","previous_headings":"","what":"openair 2.2-3","title":"openair 2.2-3","text":"CRAN release: 2018-02-26","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"main-changes-2-2-3","dir":"Changelog","previous_headings":"","what":"Main changes","title":"openair 2.2-3","text":"refine selectByDate due changes lubridate fix issue importSAQN data remove site information help importAURN point users importMeta fixed bug scatterPlot method = \"level\" due NSE use tidyr place reshape2 remove dependency plyr reshape2 fix bug percentileRose method = \"cpf\" multiple pollutants","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-21-5","dir":"Changelog","previous_headings":"","what":"openair 2.1-5","title":"openair 2.1-5","text":"CRAN release: 2017-08-31","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"main-changes-2-1-5","dir":"Changelog","previous_headings":"","what":"Main changes","title":"openair 2.1-5","text":"change polarCluster resolution “normal” rather “fine” speed . fix regression fitting smooth using trajLevel remove Airbase functions, available via new package also incorporates newer e-reporting data fix bug timeAverage statistic = \"sum\" data period missing (return 0 rather NA) make sure data used conditionalEval plots using data missing data variables used. important var.obs var.mod supplied hence additional variables considered relative obs mod. fix date issues calendarPlot time zones remove missing data type numeric value split quantiles fix bug windRose/pollutionRose two conditioning variables given (problem bias correction)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-21-0","dir":"Changelog","previous_headings":"","what":"openair 2.1-0","title":"openair 2.1-0","text":"CRAN release: 2017-04-12","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"main-changes-2-1-0","dir":"Changelog","previous_headings":"","what":"Main changes","title":"openair 2.1-0","text":"add angle option percentileRose allow wind direction averages sectors >10 degrees. fix bug aqStats lines data allow statistic equal “mean”, “median” “frequency” scatterPlot, method = \"level\" change smoothing scatterPlot method = \"level\" use tensor interaction allow better smoothing x y different scales. warn >10% negative data detected polarPlot suggest setting force.postive = FALSE make maps Suggests rather Depends refine check whether bias correction needed windRose still plot data <6 points TheilSen trend information given New function binData easily summarise mean 95% confidence intervals intervals variable Export bootMeanDF, used calculate bootstrap uncertainty mean vector.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-20-0","dir":"Changelog","previous_headings":"","what":"openair 2.0-0","title":"openair 2.0-0","text":"CRAN release: 2016-11-23","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"main-changes-2-0-0","dir":"Changelog","previous_headings":"","what":"Main changes","title":"openair 2.0-0","text":"silence download progress default importAURN update polarPlot work pairwise statistics compare two pollutants. function can consider Pearson correlation slopes ordinary linear regression, robust regression (using MASS function rlm) quantile regression (requires quantreg package installed). See open access version paper. change default polarPlot plot resolution “fine”. fix windRose problem data due missing data move mapdata package Suggests add option return meta data (site type, lat, lon) importAURN importKCL. fix statistic = “weighted.mean” issue polarPlot. make sure y.relation used grouping timePlot. retain behaviour earlier versions use relation = \"free\" fix issue type used timeProp fix bias correction default type windRose fix pch colour bug timePlot add option alpha polarPlot control transparency plotted surface. Mostly useful overlaying polar plots leaflet maps (see openairmaps package) enhance grid.line option windRose users can control grid spacing, line type line colour","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"main-changes-1-9-9","dir":"Changelog","previous_headings":"","what":"Main changes","title":"openair 1.9-9","text":"correct citation information Now depends R version >= 3.2.0 download.file can use libcurl access https (used importAURN) add avg.time option summaryPlot control averaging times time series lines print.datacap control whether data capture % shown interval. fix bug selectByDate day number work remove arrows windRose, polarPlot avoid ambiguous interpretation wind direction add key.position option timePlot control location key. fix labels timeVariation data types missing. fix trendLevel issue due dplyr use lubridate package timeAverage fix bug summaryPlot related dplyr use (plot missing data correctly) better handling precision windRose mean statistics returned data (thanks Dr Ulrich Quass) fix bug importKCL incomplete time series (drop site code site name) fix bug pollutionRose due issue calms fix bug smoothTrend model uncertainties returned fix bug summaryPlot missing data shown correctly date ordered sequence fix annotation windRose comparing two data sets GoogleMapsPlot deprecated replaced better function.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-18-6","dir":"Changelog","previous_headings":"","what":"openair 1.8-6","title":"openair 1.8-6","text":"CRAN release: 2016-06-15 plot lower triangle corPlot make sure date class POSIXct, POSIXt importAURN fix problem importMeta AURN - change database source format fix pollutionRose plot warning fix NMB modStats fix bug timeAverage estimating time interval input data unreliable due low data availability fix time expansion bug timeAverage add new type “yearseason” (“seasonyear”). split data every year / season combination, making sure seasons contiguous. example, winter northern hemisphere December 2010 considered part winter 2011, rather winter 2010. Thanks Ralf Weisse suggestion. fix download issues importAURN importMeta users within organisational network. Problems likely due move http https SSL Certificates. fix TheilSen bug two types.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-18-2","dir":"Changelog","previous_headings":"","what":"openair 1.8-2","title":"openair 1.8-2","text":"CRAN release: 2016-04-25 fixes new version dplyr adjust legends conditionalEval avoid plot error. fix problem linux simplify importAURN update importAURN meta data help function.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-18-0","dir":"Changelog","previous_headings":"","what":"openair 1.8-0","title":"openair 1.8-0","text":"CRAN release: 2016-03-24 Allow scatterPlot control plot symbol fill colour (symbols 21 25). Use cols fill control. scatterPlot can now fit one linear equation grouping variable give message using users’ type month, year etc. fix ordering bars timeProp, remove box.width option fix bug introduced 1.7-4 affected windRose bias correction (thanks Eric Christensen) Add option statistic = \"r\" polarPlot comparing polar plot correlation surfaces two pollutants using Gaussian kernel weighting. fix bug type = \"daylight\" time zone UTC. remove cutDaylight separate function (cutData works everything) add w.shift option calendarPlot control first day week subsequent order (thanks Giovanni Bonafè)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-173","dir":"Changelog","previous_headings":"","what":"openair 1.7.3","title":"openair 1.7.3","text":"Fix regression timeAverage expanding time series Remove dplyr warnings TheilSen Keep season order correct averaging time season type = \"season\" TheilSen smoothTrend add origin marker trajCluster better date padding >1 type fix dplyr bugs functions fail two types return data frame cluster information trajCluster","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-17","dir":"Changelog","previous_headings":"","what":"openair 1.7","title":"openair 1.7","text":"CRAN release: 2016-02-22 Allow linearRelation use arbitrary time averaging period. don’t add line monthly plot timeVariation group = “season” fix NA factors trajPlot make border black using maps improved clarity fix bug trajPlot sometimes failed print map grouping add percentage total trajectories trajCluster option .type don’t touch existing date-based types cutData refine date checks speed timeAverage new dependent package lubridate easier / faster date-time manipulations fix slow timeProp (lattice panel.barchart slow) remove missing wind speed windRose (wd can NA ws zero .e. calm) correct order labels timeVariation difference = TRUE factor levels (alphabetical)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-166","dir":"Changelog","previous_headings":"","what":"openair 1.6.6","title":"openair 1.6.6","text":"labels shown >25 trendLevel; make sure strip white correct bug timeVariation (vector.ws work) fix cases background strip white","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-165","dir":"Changelog","previous_headings":"","what":"openair 1.6.5","title":"openair 1.6.5","text":"CRAN release: 2015-11-04 changes fix examples run R CMD check make TaylorDiagram flexible using two groups second date-based","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-164","dir":"Changelog","previous_headings":"","what":"openair 1.6.4","title":"openair 1.6.4","text":"CRAN release: 2015-10-23 fix bug GoogleMapsPlot pollutant given don’t clutter working directory GoogleMapsPlot; write temporary file instead fix bug trying access multiple sites data fix problem multiple sites aqStats TheilSen always give trend units/year (use xlab supplied) fix cutData bug quantile cuts made don’t remove missing data scatterPlot factors data still shown TheilSen always give trend units/year (use xlab supplied) New option slope.text TheilSen allow users add text .e. default “units/year” refine check DST Always report data capture % aqStats","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-16","dir":"Changelog","previous_headings":"","what":"openair 1.6","title":"openair 1.6","text":"CRAN release: 2015-07-23 Don’t force integer results importAURN fix bug period = \"months\" summaryPlot allow linear fit method = \"hexbin\" scatterPlot allow users define map limits trajectory functions better scaled map grids fix renaming bug airbaseStats bug windRose calm date bug fixes scatterPlot add option windflow scatterPlot timePlot allow wind flow plots suppress harmless warnings smoothTrend fix bug functions type one add support pollutionRose option normalise show probability wind sector (0 1). timeAverage now option type similar functions. common use apply timeAverage data frame multiple sites column representing site name e.g. type = \"site\". Add receptor location trajectory plots trajLevel trajPlot. Add option trend TheilSen control trend lines drawn. fix bug calendarPlot partial month available fix bug calendarPlot, don’t need cut data first add npoints option trajPlot control time spacing dots shown back trajectories don’t include missing data statistic = \"frequency timeAverage fix bug timeProp due point fix bug timeVariation type = \"season\" space pollutant name","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-15","dir":"Changelog","previous_headings":"","what":"openair 1.5","title":"openair 1.5","text":"CRAN release: 2015-04-14 Add ‘days’ time unit summaryPlot - useful shorter time series Initial changes use dplyr speed code e.g. timeAverage Automate x.inc y.inc supplied user scatterPlot Fix regression trajLevel frequency calculation Fix problems trajectory plotting - methods fail given recent updates Make trajectory gridded analysis faster Fix bug importMeta introduced since using dplyr Add angle.scale windRose control placement radial scale (helps avoid clash wind rose paddles) Fix bug timePlot avg.time given (regression) Allow TaylorDiagram group length two. show group combinations differentiate colour/symbol according first grouping variable. timeVariation can now take ylim list control y-limits individual plot trajectory plotting allow map.res “state” show US States. Fix bug importKCL date beginning year","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"in-openair-11-2","dir":"Changelog","previous_headings":"","what":"in openair 1.1-2","title":"in openair 1.1-2","text":"Fix regression openair methods e.g. affected plot method timeVariation subsets Check data numeric applying running mean (crash R ) Begin transition Github, details follow Add option dist scatterPlot surface modelling Sort package dependencies etc. make maps easier load Add fontsize option openair plot functions Change contact details, fix citation problem Make sure importKCL file full year Fix warning messages aqStats multiple pollutants selected","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-11","dir":"Changelog","previous_headings":"","what":"openair 1.1","title":"openair 1.1","text":"Add ref.y option timeVariation y references line(s) Fix type = “wd” labelling corPlot Refine airbaseStats include site type city default Make trendLevel colour scaling consistent functions allow missing data shown different colour Allow categorical scales trendLevel Fix type = ‘season’ trajLevel (winter period properly calculated) Allow multiple reference lines added timePlot, scatterPlot, timeVariation add smoothTrend together full control properties. Note - ref.x ref.y must now lists; see help file details. Don’t open graphics window aqStats Add flexibility timeAverage irregular time intervals Add 12-hour interval points back trajectory lines Fix bug percentileRose stat = “cpf” non-default type (now uses single percentile based data, panel) Check date POSIXt format throw error TRUE Improve date checks selectByDate Add dendrogram option corPlot (thanks James Durant suggestion) Remove strip corPlot type = “default” Remove statistic description pollutionRose annotate = FALSE. Fix colour scaling bug scatterPlot/trajPlot user limits supplied Check period = “years” “months” summaryPlot; users supplied “year” resulting incorrect statistics Give mean percent calm pollutionRose statistic = “prop.mean” (erroneously percentage) getMet function downloading Hysplit met files manual download binary files; now corrected Add name.pol argument smoothTrend control names used plotting Show first dates import fails apply correct date format (helps provide clue actual date format) Updates trajectory plots allow different map projections using mapproj package (new dependency) Fix trajectory frequency calculation - underestimated frequencies.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-10-0","dir":"Changelog","previous_headings":"","what":"openair 1.0-0","title":"openair 1.0-0","text":"Pass arguments corPlot Enhance timeVariation consider median + quantiles option ‘statistic’ remove NA results modStats Better scaling polarCluster; consistent polarPlot Fix importKCL dates filled two non contiguous years chosen Refine scaling ws polarPlot upper set Fix bug type = “weekday” days week present Add annotate option TaylorDiagram Allow modStat statistics chosen user add Index Agreement Needs >24 months deseason smoothTrend/TheilSen (>=) Refine names returned importADMS used .pst file Fix trajectory code appendix D manual (function arguments passed) Better user defined limits scaling polarPlot, scatterPlot, polarAnnulus limits within data range Clarify time zone importing data openair checking (see manual details) Initial versions functions import EEA airbase data - see newsletter/manual details Better treatment daylight saving time cutData, timeVariation polarAnnulus (allow local time zone used; just GMT/BST ) Remove existing date-based columns cutData ensure date used instead Allow users shade/shade alternate years smoothTrend TheilSen smooth percentileRose wind direction default. Add option ‘wd’ percentileRose Fix trajPlot bug trajectory data 3-hour intervals Return data smooth fit information smoothTrend","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-09-0","dir":"Changelog","previous_headings":"","what":"openair 0.9-0","title":"openair 0.9-0","text":"CRAN release: 2013-11-12 Fix bug introduced 0.8-0 scatterPlot surfaces Add statistic percentile option polarAnnulus; allow Conditional Probability Functions Allow percentile intervals considered polarPlot statistic = “cpf” Correct calculation AOT40 aqStats take account daylight hours growing season (Apr. Sep.). Can use latitude/longitude, supplied Fix bug aqStats non predefined pollutant used Allow log10 factor 2 lines scatterPlot x /y log scale Allow users supply transform/inverse functions hexbin Don’t try pad-missing data rollingMean returning results Make latticeExtra ‘depends’ Don’t copy-data default timeAverage requested averaging time < original. Better handling ‘site’ present Update AURN help file site information; add site type Show data removed min.bin > 1 polarPlot Add ‘trim’ value percentiles polarPlot extract source information. Add ‘weights’ argument polarPlot -weight bins data points - alternative min.bin Use wd sectors surface modelling wd already rounded 10 degree intervals polarPlot Fix bug timePlot pch supplied group = TRUE. Add Air Quality Standard O3 aqStats (days >120 ug/m3) exceeded 10 days year. Add max.freq option windRose/pollutionRose control extent radial limits Add map.res option trajPlot trajLevel make default lower resolution. Make default pollutant ‘height’ (always present) Add Oslo Rotterdam trajectory database 2010-2012 Better limits control calendarPlot, use first year supplied, add option month allow selected month(s) Fix bug type = “wd” missing (remove ) Don’t open graphic window timeAverage Fix indexing problem polarCluster sometimes caused function trip plot full length trajectories trajPlot Allow smoothing parameter k used smooth = TRUE control scatterPlot Add bias correction windRose (thanks Philippe Barneoud Environment Canada pointing need solution) Better treatment pollutionRose comparing two met datasets ws bias zero Fix conditionalEval use COE, IOA minor changes Allow method = “density” trajLevel","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-08-0","dir":"Changelog","previous_headings":"","what":"openair 0.8-0","title":"openair 0.8-0","text":"CRAN release: 2013-02-13 make sure missing dates plotted properly scatterPlot fix regression corPlot - main work remove time zone options import - users must supply data GMT (UTC). many problems introduced due daylight saving time Use Legates McCabe Coefficient Efficiency modStats place Index Agreement - easier interpret. Allow type = “month” etc used timeVariation (variable clash). Allow flexibility group type used Better handling user-defined limits polarPlot scatterPlot (method = “level”) Add optional mean line option percentileRose. Correct pollutionRose documentation comparing 2 data sets (first subtracted second) Fix bug timeVariation showed extra NA level certain groups/types Fix scaling bug polarCluster negative data e.g. x = “temp” Allow statistic = “median” trajLevel NEW FUNCTION timeProp plot time series category bar chart Fix windRose bug wind direction name wd Fix bug importAURN pollutant = “” specified Allow minimum value breaks ws minimum ws value, warn. Allow day numeric selectByDate select days month Better base maps trajectory plotting (filled alpha transparency) Fix windRose bug data missing Use higher resolution mapdata maps package trajectory plots Allow method = “hexbin” trajLevel hexagonal binning trajectory frequencies Refine rollingMean allow moving window aligned centre/center, left right + better treatment ends data capture threshold used. Use option ‘width’ rather ‘hours’ non-hourly data can considered. Fix pollutionRose scaling issue, sometimes missed lower interval Fix timeAverage data capture issue - always setting data NA Output clusters C1, C2 etc. 1, 2. Use labelling calendarPlot functions (wrong month order non-English locales) Export dendogram corPlot - see example help file Fix scaling bug polarPlot radial variable negative small Update ‘mydata’ set negative data NA Add method = CPF percentile rose polarPlot Update trajectory analysis allow Potential Source Contribution Function (PSCF) Concentration Weighted Trajectory (CWT) considered","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-07-0","dir":"Changelog","previous_headings":"","what":"openair 0.7-0","title":"openair 0.7-0","text":"CRAN release: 2012-09-19 Allow flexible layout two pollutants used polarPlot type default Fix colour scale problem windRose interval exist Added ‘nativeRaster’ class handler GoogleMapsPlots (test) Fix GoogleMapsPlot xlim, ylim remove missing data timeVariation Fix bug FAC2 modStats observations = 0 (exclude calculation indeterminate) Fix bug windRose empty panels panel labelling data missing New option start.day cutData affects plots; allows users set start day type = “weekday” Allow categorical scales calendarPlot Allow two met data sets compared pollutionRose Allow statistic = “percentile” used polarPlot Allow ‘method’ passed cor corPlot Added back trajectory locations. Try harder plot polarPlots insufficient data calculate smooth surface. Rename variables timeAverage avoid variable clash. Add gridded frequency capability trajLevel Fix bug colour scaling polarFreq statistic = “stdev” (0 plotted) Fix bug summaryPlot: type = “density” broken recent versions","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-06-0","dir":"Changelog","previous_headings":"","what":"openair 0.6-0","title":"openair 0.6-0","text":"CRAN release: 2012-05-11 Add y.relation option timePlot Fix interpolation bug calcFno2 names documentation. Refine conditionalQuantile scales Provide volatile non-volatile components FDMS PM10 PM2.5 importKCL - now consistent importAURN NEW FUNCTION conditionalEval model evaluation - allows variable performance assessed. Make lattice strips white default cleaner look complicated plots Complete re-write import simplify - changes backward compatible allow developments thanks Karl Allow better annotation calendarPlot - highlight values /certain threshold.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-25","dir":"Changelog","previous_headings":"","what":"openair 0.5-25","title":"openair 0.5-25","text":"CRAN release: 2012-03-19 Fix bug type = “wd” - add missing data north sector Add observed histogram conditionalQuantile Fix bug timeAverage ws available wd Temporary fix GoogleMapsPlot documentation due new package version","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-23","dir":"Changelog","previous_headings":"","what":"openair 0.5-23","title":"openair 0.5-23","text":"CRAN release: 2012-03-05 Fix bug windRose paddle = FALSE","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-22","dir":"Changelog","previous_headings":"","what":"openair 0.5-22","title":"openair 0.5-22","text":"Fix scaling bug sometime affect polarPlot grid lines Fix regression importKCL introduced 0.5-21 Make sure wd data rounded 10 degrees polarFreq Fix date padding issue smoothTrend type = “site” windRose now gives mean ws panel rather count add option date.format timePlot control date format axis","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-21","dir":"Changelog","previous_headings":"","what":"openair 0.5-21","title":"openair 0.5-21","text":"CRAN release: 2012-02-22 Use C++ code rolling mean calcs. Much faster, follow NEW function trajCluster carry cluster analysis back trajectories Simple model ranking available modStats # Changes openair 0.5-18 [2012-01-16] Update trajectory files 2011 add Berlin, Paris Add option seg pollutionRose control width segments Add option start.day timeVariation control order weekdays. Fixed bug polarAnnulus 360 degree winds absent. Remove dependency zoo proto. Allow importAURN import new ws/wd pre-calculated WRF data AURN sites","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-17","dir":"Changelog","previous_headings":"","what":"openair 0.5-17","title":"openair 0.5-17","text":"Update [DEVELOPMENT] GoogleMapsPlot. (1 lat,lon default handling)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-15","dir":"Changelog","previous_headings":"","what":"openair 0.5-15","title":"openair 0.5-15","text":"Update imports etc.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-15-1","dir":"Changelog","previous_headings":"","what":"openair 0.5-15","title":"openair 0.5-15","text":"Update [DEVELOPMENT] GoogleMapsPlot. Tidy calcFno2 plotting. Improve speed timeAverage removing date.pad. Add vector averaging option timeAverage wind speed.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-14","dir":"Changelog","previous_headings":"","what":"openair 0.5-14","title":"openair 0.5-14","text":"NEW FUNCTION polarCluster undertaking k-means clustering bivariate polar plots Remove considerations time zones selectByDate. start end supplied, whole days based Date format used select. Now accepts start/end form “YYYY-mm-dd” well UK format e.g. dd/mm/YYYY.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-13","dir":"Changelog","previous_headings":"","what":"openair 0.5-13","title":"openair 0.5-13","text":"Major update polarPlot allowing variables “ws” plotted wind direction. Improve documentation polarPlot/TaylorDiagram Update openair citation information Journal article","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-12","dir":"Changelog","previous_headings":"","what":"openair 0.5-12","title":"openair 0.5-12","text":"clip polarPlot concentrations unless upper supplied new option ‘intervals’ percentileRose add min.bin option polarAnnulus add Index Agreement modStats new averaging time “season” timeAverage better treatment avg.time = “season” type = “season” TheilSen smoothTrend use bootstrap methods calculate 95% confidence intervals mean timeVariation New option ‘difference’ timeVariation show difference two variables bootstrap 95% CI mean Byte-compile package Place key right default scatterPlot avoid clash x y axis labels. Include colour schemes defined RColorBrewer package","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-11","dir":"Changelog","previous_headings":"","what":"openair 0.5-11","title":"openair 0.5-11","text":"CRAN release: 2011-10-05 update corPlot, scatterPlot, smoothTrend, linearRelation, percentileRose, trajPlot, trajLevel, timeVariation, TaylorDiagram, timePlot, summaryPlot improved … handling remove warnings importing air pollution data additional update corPlot added pollutant option, openair class output tweak scaling percentileRose deal negative data change MannKendall use TheilSen estimates consistency. May slightly affect p estimates.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-10","dir":"Changelog","previous_headings":"","what":"openair 0.5-10","title":"openair 0.5-10","text":"update calendarPlot, kernelExceed, MannKendall conditionalQuantile improved … handling minor update GoogleMapsPlot","code":"minor update to GoogleMapsPlot"},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-9","dir":"Changelog","previous_headings":"","what":"openair 0.5-9","title":"openair 0.5-9","text":"allow model performance change considered TaylorDiagram update windRose pollutionRose stat related annotation update polarPlot, ploarFreq polarAnnulus improved … handling","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-8","dir":"Changelog","previous_headings":"","what":"openair 0.5-8","title":"openair 0.5-8","text":"NEW FUNCTION importMeta import site meta data air pollution networks","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-7","dir":"Changelog","previous_headings":"","what":"openair 0.5-7","title":"openair 0.5-7","text":"update trendLevel: improved … handling update windRose/pollutionRose: added statistic option “abs.count”; improved scaling segment widths; improved … handling","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-6","dir":"Changelog","previous_headings":"","what":"openair 0.5-6","title":"openair 0.5-6","text":"NEW FUNCTIONS importTraj, trajPlot, trajLevel importing plotting pre-defined HYSPLIT back trajectories. functions active development testing purposes ! Fix error % upper/lower uncertainty intervals MannKendall arguments text.col, lab.frac (vertical position) lab.cex (font size)","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-4","dir":"Changelog","previous_headings":"","what":"openair 0.5-4","title":"openair 0.5-4","text":"Use roxygen2 package documentation future maintainability Allow splitByDate handle multiple sites output new column controlled argument ‘name’ options MannKendall: control colour variable x-axis scales","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-05-0","dir":"Changelog","previous_headings":"","what":"openair 0.5-0","title":"openair 0.5-0","text":"NEW FUNCTION corPlot correlation matrices add sep argument import","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-23","dir":"Changelog","previous_headings":"","what":"openair 0.4-23","title":"openair 0.4-23","text":"CRAN release: 2011-07-26 enhance ‘normalise’ option timePlot add annotate option windRose/pollutionRose NEW FUNCTION TaylorDiagram model evaluation.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-22","dir":"Changelog","previous_headings":"","what":"openair 0.4-22","title":"openair 0.4-22","text":"NOTE - use reshape2 place reshape speed reliability allow one pollutant percentileRose fixed title bug scatterPlot - shown methods modified key handling plots using drawOpenKey, key = NULL FALSE now removes colour key. added method = “level” scatterPlot binning data optional smoothing, plus code clean-ups fix bug conditionalQuantile labelled plots wrongly site(s) missing data added ref.x ref.y timePlot allow reference lines added remove calm wind speed conditions functions necessary","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-21","dir":"Changelog","previous_headings":"","what":"openair 0.4-21","title":"openair 0.4-21","text":"fixed bug polarAnnulus resulted failure annotate plot properly period = “trend” less 1 year data; improved smoothing default options used new ‘statistic’ option pollutionRose show contribution counts contribution mean. latter useful displaying wind directions make contribution overall mean. Panel mean also now shown. small change final example re-shaping data importKCL timeAverage can now expand data shorter time periods e.g. hourly 15-minute. makes flexible combine data sets differing averaging times. example, daily mean particle data can expanded 1-hour means combined hourly meteorological data set. Fix treatment calms checkPrep, affected cases zero wind speeds timeAverage Fix vector averaging timeAverage (include wind speed calculations). data make little difference, important low wind speeds /variable wind directions. allow type = ‘variable’ smoothTrend Add avg.time smoothTrend “month” “year” averages","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-20","dir":"Changelog","previous_headings":"","what":"openair 0.4-20","title":"openair 0.4-20","text":"remove calms timeAverage NEW FUNCTION importSAQN import data Scottish Air Quality Network","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-19","dir":"Changelog","previous_headings":"","what":"openair 0.4-19","title":"openair 0.4-19","text":"improved import date.name/time.name handling spaces Improved scaling polarFreq scatterPlot type = “wd” labels aligned Added option “statistic” polarPlot, can now consider “mean”, “median”, “max” (maximum), “frequency”. “stdev” (standard deviation) “weighted.mean” similar way polarFreq Fixed bad.24 international tz bugs import updated import/import.2","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-18","dir":"Changelog","previous_headings":"","what":"openair 0.4-18","title":"openair 0.4-18","text":"Better handling missing data smoothTrend/MannKendall; particularly multiple sites run checkPrep selectByDate removes calms Fixed scaling bug polarFreq ws.int != 1 use avg.time calcPercentile instead ‘period’ ensure consistency functions (timePlot fail percentiles) return NA aqStats data present; previously tried calculate quantities, returning -Inf etc","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-17","dir":"Changelog","previous_headings":"","what":"openair 0.4-17","title":"openair 0.4-17","text":"CRAN release: 2011-04-24 use readRDS .readRDS (caused failure R Dev) openair now depends >=R2.13.0 NEW FUNCTION sqStats calculate common pollutant-specific air quality statistics year site. Changed option data.capture rollingMean data.thresh consistent functions.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-16","dir":"Changelog","previous_headings":"","what":"openair 0.4-16","title":"openair 0.4-16","text":"Fixed bugs cutData partial year used type = “month”. Also affected type = “season” “weekday”. plots labelled wrong order. Ensure missing wind sectors skipped type = “wd” smoothTrend, MannKendall, timePlot scatterPlot","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-15","dir":"Changelog","previous_headings":"","what":"openair 0.4-15","title":"openair 0.4-15","text":"CRAN release: 2011-04-12 Preparation CRAN release removed restrictions type/period combinations polarAnnulus","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-14","dir":"Changelog","previous_headings":"","what":"openair 0.4-14","title":"openair 0.4-14","text":"Added preliminary greyscale method openColours linked strip background text line colour control standard openair plots.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-13","dir":"Changelog","previous_headings":"","what":"openair 0.4-13","title":"openair 0.4-13","text":"Removed ad-hoc sites importKCL, added site classification help file ensured GMT exported.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-12","dir":"Changelog","previous_headings":"","what":"openair 0.4-12","title":"openair 0.4-12","text":"Added y.relation option smoothTrend MannKendall allow flexible y-scales. NEW FUNCTION ‘percentileRose’ flexible plotting percentiles wind direction NEW FUNCTION selectRunning selecting run lengths numeric variable certain threshold. Modified plot layout polarPlot maximise plotting area Initial fixes functions affected time zone settings polarFreq now consistent annotation cf. windRose percentileRose; new option grid.line control radial axes. Fixed couple minor auto.text bugs summaryPlot timePlot Removed dependency date polar functions time-based types required.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-11","dir":"Changelog","previous_headings":"","what":"openair 0.4-11","title":"openair 0.4-11","text":"consistent use strips default plot (remove ) Add percentage units windRose pollutionRose radial scale","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-10","dir":"Changelog","previous_headings":"","what":"openair 0.4-10","title":"openair 0.4-10","text":"CRAN release: 2011-03-08 Fixed calendarPlot main/quickText handling. Fixed calendarPlot first day month error. Fixed summaryPlot site ordering one site.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-9","dir":"Changelog","previous_headings":"","what":"openair 0.4-9","title":"openair 0.4-9","text":"Added new options scatterPlot (plot.type, lwd, lty) making possible add points /lines","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-8","dir":"Changelog","previous_headings":"","what":"openair 0.4-8","title":"openair 0.4-8","text":"Added new cutData type option ‘daylight’, enabled using new function cutDaylight.","code":""},{"path":"https://davidcarslaw.github.io/openair/news/index.html","id":"openair-04-7","dir":"Changelog","previous_headings":"","what":"openair 0.4-7","title":"openair 0.4-7","text":"CRAN release: 2011-02-17 Added new function conditionalQuantile model evaluation purposes. Fixed `importAURN` account change web domain address AEA.","code":"Added new function conditionalQuantile for model evaluation purposes. Fixed `importAURN` to account for a change in web domain address at AEA."}]
+[{"path":[]},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behaviour contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behaviour include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible via GitHub platform. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behaviour deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behaviour inappropriate. public apology may requested.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behaviour. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behaviour. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://davidcarslaw.github.io/openair/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to openairmaps","title":"Contributing to openairmaps","text":"outlines propose change openairmaps.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to openairmaps","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to openairmaps","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to openairmaps","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"davidcarslaw/openair\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header).","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to openairmaps","text":"Care taken new code follows style similar rest openair. user-facing example exported functions written “lowerCamelCase” (.e., polarPlot() rather polar_plot()). use roxygen2, Markdown syntax, documentation.","code":""},{"path":"https://davidcarslaw.github.io/openair/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to openairmaps","text":"Please note openair project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 2, June 1991Copyright © 1989, 1991 Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"licenses software designed take away freedom share change . contrast, GNU General Public License intended guarantee freedom share change free software–make sure software free users. General Public License applies Free Software Foundation’s software program whose authors commit using . (Free Software Foundation software covered GNU Lesser General Public License instead.) can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge service wish), receive source code can get want , can change software use pieces new free programs; know can things. protect rights, need make restrictions forbid anyone deny rights ask surrender rights. restrictions translate certain responsibilities distribute copies software, modify . example, distribute copies program, whether gratis fee, must give recipients rights . must make sure , , receive can get source code. must show terms know rights. protect rights two steps: (1) copyright software, (2) offer license gives legal permission copy, distribute /modify software. Also, author’s protection , want make certain everyone understands warranty free software. software modified someone else passed , want recipients know original, problems introduced others reflect original authors’ reputations. Finally, free program threatened constantly software patents. wish avoid danger redistributors free program individually obtain patent licenses, effect making program proprietary. prevent , made clear patent must licensed everyone’s free use licensed . precise terms conditions copying, distribution modification follow.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"terms-and-conditions-for-copying-distribution-and-modification","dir":"","previous_headings":"","what":"TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION","title":"GNU General Public License","text":"0. License applies program work contains notice placed copyright holder saying may distributed terms General Public License. “Program”, , refers program work, “work based Program” means either Program derivative work copyright law: say, work containing Program portion , either verbatim modifications /translated another language. (Hereinafter, translation included without limitation term “modification”.) licensee addressed “”. Activities copying, distribution modification covered License; outside scope. act running Program restricted, output Program covered contents constitute work based Program (independent made running Program). Whether true depends Program . 1. may copy distribute verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice disclaimer warranty; keep intact notices refer License absence warranty; give recipients Program copy License along Program. may charge fee physical act transferring copy, may option offer warranty protection exchange fee. 2. may modify copy copies Program portion , thus forming work based Program, copy distribute modifications work terms Section 1 , provided also meet conditions: ) must cause modified files carry prominent notices stating changed files date change. b) must cause work distribute publish, whole part contains derived Program part thereof, licensed whole charge third parties terms License. c) modified program normally reads commands interactively run, must cause , started running interactive use ordinary way, print display announcement including appropriate copyright notice notice warranty (else, saying provide warranty) users may redistribute program conditions, telling user view copy License. (Exception: Program interactive normally print announcement, work based Program required print announcement.) requirements apply modified work whole. identifiable sections work derived Program, can reasonably considered independent separate works , License, terms, apply sections distribute separate works. distribute sections part whole work based Program, distribution whole must terms License, whose permissions licensees extend entire whole, thus every part regardless wrote . Thus, intent section claim rights contest rights work written entirely ; rather, intent exercise right control distribution derivative collective works based Program. addition, mere aggregation another work based Program Program (work based Program) volume storage distribution medium bring work scope License. 3. may copy distribute Program (work based , Section 2) object code executable form terms Sections 1 2 provided also one following: ) Accompany complete corresponding machine-readable source code, must distributed terms Sections 1 2 medium customarily used software interchange; , b) Accompany written offer, valid least three years, give third party, charge cost physically performing source distribution, complete machine-readable copy corresponding source code, distributed terms Sections 1 2 medium customarily used software interchange; , c) Accompany information received offer distribute corresponding source code. (alternative allowed noncommercial distribution received program object code executable form offer, accord Subsection b .) source code work means preferred form work making modifications . executable work, complete source code means source code modules contains, plus associated interface definition files, plus scripts used control compilation installation executable. However, special exception, source code distributed need include anything normally distributed (either source binary form) major components (compiler, kernel, ) operating system executable runs, unless component accompanies executable. distribution executable object code made offering access copy designated place, offering equivalent access copy source code place counts distribution source code, even though third parties compelled copy source along object code. 4. may copy, modify, sublicense, distribute Program except expressly provided License. attempt otherwise copy, modify, sublicense distribute Program void, automatically terminate rights License. However, parties received copies, rights, License licenses terminated long parties remain full compliance. 5. required accept License, since signed . However, nothing else grants permission modify distribute Program derivative works. actions prohibited law accept License. Therefore, modifying distributing Program (work based Program), indicate acceptance License , terms conditions copying, distributing modifying Program works based . 6. time redistribute Program (work based Program), recipient automatically receives license original licensor copy, distribute modify Program subject terms conditions. may impose restrictions recipients’ exercise rights granted herein. responsible enforcing compliance third parties License. 7. , consequence court judgment allegation patent infringement reason (limited patent issues), conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. distribute satisfy simultaneously obligations License pertinent obligations, consequence may distribute Program . example, patent license permit royalty-free redistribution Program receive copies directly indirectly , way satisfy License refrain entirely distribution Program. portion section held invalid unenforceable particular circumstance, balance section intended apply section whole intended apply circumstances. purpose section induce infringe patents property right claims contest validity claims; section sole purpose protecting integrity free software distribution system, implemented public license practices. Many people made generous contributions wide range software distributed system reliance consistent application system; author/donor decide willing distribute software system licensee impose choice. section intended make thoroughly clear believed consequence rest License. 8. distribution /use Program restricted certain countries either patents copyrighted interfaces, original copyright holder places Program License may add explicit geographical distribution limitation excluding countries, distribution permitted among countries thus excluded. case, License incorporates limitation written body License. 9. Free Software Foundation may publish revised /new versions General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies version number License applies “later version”, option following terms conditions either version later version published Free Software Foundation. Program specify version number License, may choose version ever published Free Software Foundation. 10. wish incorporate parts Program free programs whose distribution conditions different, write author ask permission. software copyrighted Free Software Foundation, write Free Software Foundation; sometimes make exceptions . decision guided two goals preserving free status derivatives free software promoting sharing reuse software generally.","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"no-warranty","dir":"","previous_headings":"","what":"NO WARRANTY","title":"GNU General Public License","text":"11. PROGRAM LICENSED FREE CHARGE, WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION. 12. EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MAY MODIFY /REDISTRIBUTE PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES. END TERMS CONDITIONS","code":""},{"path":"https://davidcarslaw.github.io/openair/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively convey exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program interactive, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, commands use may called something show w show c; even mouse-clicks menu items–whatever suits program. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. sample; alter names: General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License.","code":" Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice"},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"import-data-from-the-uk-automatic-urban-and-rural-network","dir":"Articles","previous_headings":"","what":"Import data from the UK Automatic Urban and Rural Network","title":"Examples of {openair} Functionality","text":"easy import hourly data 100s sites import several sites one time several years data.","code":"kc1 <- importAURN(site = \"kc1\", year = 2020) kc1 #> # A tibble: 8,784 × 15 #> source site code date co nox no2 no o3 so2 #> #> 1 aurn London … KC1 2020-01-01 00:00:00 0.214 64.8 46.2 12.1 1.13 NA #> 2 aurn London … KC1 2020-01-01 01:00:00 0.237 74.1 45.0 19.0 1.20 NA #> 3 aurn London … KC1 2020-01-01 02:00:00 0.204 60.5 41.4 12.4 1.50 NA #> 4 aurn London … KC1 2020-01-01 03:00:00 0.204 53.5 39.8 8.93 1.60 NA #> 5 aurn London … KC1 2020-01-01 04:00:00 0.169 37.7 33.6 2.63 5.79 NA #> 6 aurn London … KC1 2020-01-01 05:00:00 0.160 43.3 36.8 4.25 6.09 NA #> 7 aurn London … KC1 2020-01-01 06:00:00 0.157 48.2 39.4 5.76 2.74 NA #> 8 aurn London … KC1 2020-01-01 07:00:00 0.178 60.5 44.7 10.3 1.20 NA #> 9 aurn London … KC1 2020-01-01 08:00:00 0.233 71.8 47.9 15.6 2.25 NA #> 10 aurn London … KC1 2020-01-01 09:00:00 0.329 128. 46.9 53.2 2.25 NA #> # ℹ 8,774 more rows #> # ℹ 5 more variables: pm10 , pm2.5 , ws , wd , #> # air_temp "},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"utility-functions","dir":"Articles","previous_headings":"","what":"Utility functions","title":"Examples of {openair} Functionality","text":"Using selectByDate() function easy select quite complex time-based periods. example, select weekday (Monday Friday) data June September 2012 hours 7am 7pm inclusive: Similarly easy time-average data many flexible ways. example, 2-week means can calculated ","code":"sub <- selectByDate( kc1, day = \"weekday\", year = 2020, month = 6:9, hour = 7:19 ) sub #> # A tibble: 1,144 × 15 #> date source site code co nox no2 no o3 so2 #> #> 1 2020-06-01 07:00:00 aurn London… KC1 0.125 23.1 16.8 4.14 56.5 2.29 #> 2 2020-06-01 08:00:00 aurn London… KC1 0.133 25.2 17.8 4.79 61.7 2.68 #> 3 2020-06-01 09:00:00 aurn London… KC1 0.119 15.6 12.2 2.22 75.8 2.35 #> 4 2020-06-01 10:00:00 aurn London… KC1 0.104 13.8 11.1 1.79 87.1 1.57 #> 5 2020-06-01 11:00:00 aurn London… KC1 0.0956 14.0 11.8 1.46 96.7 1.44 #> 6 2020-06-01 12:00:00 aurn London… KC1 0.0985 11.3 9.97 0.893 106. 1.44 #> 7 2020-06-01 13:00:00 aurn London… KC1 0.0927 11.0 9.64 0.893 112. 2.03 #> 8 2020-06-01 14:00:00 aurn London… KC1 0.0927 12.5 10.8 1.14 114. 2.81 #> 9 2020-06-01 15:00:00 aurn London… KC1 0.0811 10.7 9.48 0.822 115. 2.88 #> 10 2020-06-01 16:00:00 aurn London… KC1 0.0898 13.9 11.9 1.29 104. 2.22 #> # ℹ 1,134 more rows #> # ℹ 5 more variables: pm10 , pm2.5 , ws , wd , #> # air_temp sub2 <- timeAverage(kc1, avg.time = \"2 week\") sub2 #> # A tibble: 27 × 12 #> date co nox no2 no o3 so2 pm10 pm2.5 ws #> #> 1 2019-12-30 00:00:00 0.135 26.2 22.7 2.34 46.4 1.94 12.5 8.43 3.94 #> 2 2020-01-13 00:00:00 0.205 74.4 37.3 24.2 30.4 2.68 18.5 13.1 3.11 #> 3 2020-01-27 00:00:00 0.143 39.4 26.7 8.24 47.8 2.72 13.9 8.45 4.51 #> 4 2020-02-10 00:00:00 0.118 19.2 16.4 1.85 63.0 3.09 9.40 5.03 6.18 #> 5 2020-02-24 00:00:00 0.144 31.4 24.5 4.50 53.5 2.61 10.4 5.99 4.54 #> 6 2020-03-09 00:00:00 0.116 19.7 17.0 1.73 60.0 2.09 10.0 5.73 4.61 #> 7 2020-03-23 00:00:00 0.132 23.2 19.8 2.26 69.1 1.90 18.9 12.3 3.61 #> 8 2020-04-06 00:00:00 0.112 27.1 24.1 1.99 72.4 2.02 26.1 18.2 2.96 #> 9 2020-04-20 00:00:00 0.103 15.8 14.1 1.13 76.7 2.09 16.8 9.60 3.45 #> 10 2020-05-04 00:00:00 0.112 17.8 15.7 1.35 76.0 1.85 13.7 8.32 3.29 #> # ℹ 17 more rows #> # ℹ 2 more variables: wd , air_temp "},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"the-type-option","dir":"Articles","previous_headings":"","what":"The type option","title":"Examples of {openair} Functionality","text":"One key aspects openair use type option, available almost openair functions. type option partitions data different categories variable. many built-options type can take based splitting data different date values. summary -built values type : \"year\" splits data year \"month\" splits variables month year \"monthyear\" splits data year month \"season\" splits variables season. Note case user can also supply hemisphere option can either \"northern\" (default) \"southern\" \"weekday\" splits variables day week \"weekend\" splits variables Saturday, Sunday, weekday \"daylight\" splits variables nighttime/daytime. Note user must supply longitude latitude \"dst\" splits variables daylight saving time non-daylight saving time \"wd\" wind direction (wd) available. type = \"wd\" split data 8 sectors: N, NE, E, SE, S, SW, W, NW. \"seasonyear\" (\"yearseason\") split data year-season intervals, keeping months season together. example, December 2010 considered part winter 2011 (January February 2011). makes easier consider contiguous seasons. contrast, type = \"season\" just split data four seasons regardless year. type can also use variables already data frame: categorical variable specified, e.g., site variables can used directly e.g. type = \"site\". numeric numeric variable specified split 4 quantiles, .e., four partitions containing equal numbers points. Note user can supply option n.levels indicate many quantiles use.","code":""},{"path":"https://davidcarslaw.github.io/openair/articles/openair.html","id":"example-directional-analysis","dir":"Articles","previous_headings":"","what":"Example directional analysis","title":"Examples of {openair} Functionality","text":"openair can plot basic wind roses easily provided variables ws (wind speed) wd (wind direction) available. However, real flexibility comes able use type option. Wind roses summarising wind conditions monitoring station per year, demonstrating openair type option. many flavours bivariate polar plots, described useful understanding air pollution sources.","code":"windRose(mydata) windRose(mydata, type = \"year\", layout = c(4, 2) ) polarPlot(mydata, pollutant = \"so2\", statistic = \"cpf\", percentile = 90, cols = \"YlGnBu\" )"},{"path":"https://davidcarslaw.github.io/openair/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"David Carslaw. Author, maintainer. Jack Davison. Author. Karl Ropkins. Author.","code":""},{"path":"https://davidcarslaw.github.io/openair/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Carslaw, D. C. K. Ropkins, (2012) openair --- R package air quality data analysis. Environmental Modelling & Software. Volume 27-28, 52-61.","code":"@Article{, title = {openair --- An R package for air quality data analysis}, author = {David C. Carslaw and Karl Ropkins}, journal = {Environmental Modelling & Software}, volume = {27--28}, number = {0}, pages = {52--61}, year = {2012}, issn = {1364-8152}, doi = {10.1016/j.envsoft.2011.09.008}, }"},{"path":[]},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_-core-features","dir":"","previous_headings":"","what":"💡 Core Features","title":"Tools for the Analysis of Air Pollution Data","text":"openair developed many years form extensive toolkit functions analysing air quality atmospheric composition data. Access data several hundred UK air pollution monitoring sites importUKAQ() family functions. Time Series & Trend analysis explore air quality concentrations vary time (e.g., timePlot(), timeVariation(), calendarPlot()). Directional analysis help characterise different sources pollution, including creation bivariate polar plots using polarPlot(). Trajectory analysis examine NOAA Hysplit trajectories, plotting (trajPlot()), heatmap (trajLevel()) clustering (trajCluster()) functionality. Utility functions, timeAverage() selectByDate() make easier manipulate atmospheric composition data. Flexible plot conditioning easily plot data hour day, day week, season year, etc., type option available functions.","code":""},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_-documentation","dir":"","previous_headings":"","what":"📖 Documentation","title":"Tools for the Analysis of Air Pollution Data","text":"openair functions fully documented; access documentation using R IDE choice. Documentation also hosted online package website. guide openair toolkit can found online book, contains lots code snippets, demonstrations functionality, ideas application openair’s various functions.","code":"?openair::polarPlot"},{"path":"https://davidcarslaw.github.io/openair/index.html","id":"id_️-installation","dir":"","previous_headings":"","what":"🗃️ Installation","title":"Tools for the Analysis of Air Pollution Data","text":"openair can installed CRAN : can also install development version openair GitHub using pak: 🏛️ openair primarily maintained David Carslaw. 📃 openair licensed GNU General Public License. 🧑💻 Contributions welcome wider community. See contributing guide code conduct information.","code":"install.packages(\"openair\") # install.packages(\"pak\") pak::pak(\"davidcarslaw/openair\")"},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":null,"dir":"Reference","previous_headings":"","what":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Function draw Taylor Diagrams model evaluation. function allows conditioning categorical numeric variables, makes function flexible.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"","code":"TaylorDiagram( mydata, obs = \"obs\", mod = \"mod\", group = NULL, type = \"default\", normalise = FALSE, cols = \"brewer1\", rms.col = \"darkgoldenrod\", cor.col = \"black\", arrow.lwd = 3, annotate = \"centred\\nRMS error\", text.obs = \"observed\", key = TRUE, key.title = group, key.columns = 1, key.pos = \"right\", strip = TRUE, auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"mydata data frame minimally containing column observations column predictions. obs column observations predictions (mod) compared. mod column model predictions. Note, mod can length 2 .e. two lots model predictions. two sets predictions present e.g. mod = c(\"base\", \"revised\"), arrows shown Taylor Diagram show change model performance going first second. useful , example, interest comparing one model run compares another using different assumptions e.g. input data model set . See examples . group group column used differentiate different models can factor character. total number models compared equal number unique values group. group can also length two e.g. group = c(\"model\", \"site\"). case model-site combinations shown differentiated colour/symbol first grouping variable (\"model\" case). essence plot removes differentiation second grouping variable. different values obs group, normalise = TRUE used. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. Note often make sense use type = \"site\" multiple sites available. ensure panel contains data specific individual site. normalise data normalised dividing standard deviation observations? statistics can normalised (non-dimensionalised) dividing RMS difference standard deviation mod values standard deviation observations (obs). case “observed” point plotted x-axis unit distance origin. makes possible plot statistics different species (maybe different units) plot. normalisation done group/type combination. cols Colours used plotting. Useful options categorical data available RColorBrewer colours — see openair openColours function details. Useful schemes include “Accent”, “Dark2”, “Paired”, “Pastel1”, “Pastel2”, “Set1”, “Set2”, “Set3” — see ?brewer.pal maximum useful colours . user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). rms.col Colour centred-RMS lines text. cor.col Colour correlation coefficient lines text. arrow.lwd Width arrow used used comparing two model outputs. annotate Annotation shown RMS error. text.obs plot annotation observed values; default \"observed\". key key shown? key.title Title key. key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.pos Position key e.g. “top”, “bottom”, “left” “right”. See details lattice:xyplot details finer control. strip strip shown? auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto cutData lattice:xyplot. example, TaylorDiagram passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common graphical parameters, layout panel arrangement pch cex plot symbol type size, passed xyplot. passed unmodified, although special cases openair may locally manage process. example, common axis title labelling options (xlab, ylab, main) passed via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"openair object. retained, e.g., using output <- TaylorDiagram(thedata, obs = \"nox\", mod = \"mod\"), output can used recover data, reproduce rework original plot undertake analysis. example, output$data data frame consisting group, type, correlation coefficient (R), standard deviation observations measurements.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Taylor Diagram useful model evaluation tool. diagram provides way showing three complementary model performance statistics vary simultaneously. statistics correlation coefficient R, standard deviation (sigma) (centred) root-mean-square error. three statistics can plotted one (2D) graph way related one another can represented Law Cosines. openair version Taylor Diagram several enhancements increase flexibility. particular, straightforward way producing conditioning plots prove valuable many circumstances (using type option). Many examples Taylor Diagrams focus model-observation comparisons several models using available data. However, insight can gained model performance partitioning data various ways e.g. season, daylight/nighttime, day week, levels numeric variable e.g. wind speed land-use type etc. consider several pollutants one plot, column identifying pollutant name can used e.g. pollutant. Taylor Diagram can plotted (assuming data frame thedata): TaylorDiagram(thedata, obs = \"obs\", mod = \"mod\", group = \"model\", type = \"pollutant\") give model performance pollutant panel. Note important panel represents data mean observed data across different groups. Therefore TaylorDiagram(mydata, group = \"model\", type = \"season\") OK, whereas TaylorDiagram(mydata, group = \"season\", type = \"model\") panel (representing model) four different mean values — one season. Generally, option group either missing (one model evaluated) represents column giving model name. However, data can normalised using normalise option. Normalisation carried per group/type basis making possible compare data different scales e.g. TaylorDiagram(mydata, group = \"season\", type = \"model\", normalise = TRUE). way possible compare different pollutants, sites etc. panel. Also note multiple sites present makes sense use type = \"site\" ensure panel represents individual site specific standard deviation etc. case select single site data first e.g. subset(mydata, site == \"Harwell\").","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"Taylor, K.E.: Summarizing multiple aspects model performance single diagram. J. Geophys. Res., 106, 7183-7192, 2001 (also see PCMDI Report 55).","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TaylorDiagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Taylor Diagram for model evaluation with conditioning — TaylorDiagram","text":"","code":"## in the examples below, most effort goes into making some artificial data ## the function itself can be run very simply if (FALSE) { # \\dontrun{ ## dummy model data for 2003 dat <- selectByDate(mydata, year = 2003) dat <- data.frame(date = mydata$date, obs = mydata$nox, mod = mydata$nox) ## now make mod worse by adding bias and noise according to the month ## do this for 3 different models dat <- transform(dat, month = as.numeric(format(date, \"%m\"))) mod1 <- transform(dat, mod = mod + 10 * month + 10 * month * rnorm(nrow(dat)), model = \"model 1\") ## lag the results for mod1 to make the correlation coefficient worse ## without affecting the sd mod1 <- transform(mod1, mod = c(mod[5:length(mod)], mod[(length(mod) - 3) : length(mod)])) ## model 2 mod2 <- transform(dat, mod = mod + 7 * month + 7 * month * rnorm(nrow(dat)), model = \"model 2\") ## model 3 mod3 <- transform(dat, mod = mod + 3 * month + 3 * month * rnorm(nrow(dat)), model = \"model 3\") mod.dat <- rbind(mod1, mod2, mod3) ## basic Taylor plot TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = \"model\") ## Taylor plot by season TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = \"model\", type = \"season\") ## now show how to evaluate model improvement (or otherwise) mod1a <- transform(dat, mod = mod + 2 * month + 2 * month * rnorm(nrow(dat)), model = \"model 1\") mod2a <- transform(mod2, mod = mod * 1.3) mod3a <- transform(dat, mod = mod + 10 * month + 10 * month * rnorm(nrow(dat)), model = \"model 3\") mod.dat2 <- rbind(mod1a, mod2a, mod3a) mod.dat$mod2 <- mod.dat2$mod ## now we have a data frame with 3 models, 1 set of observations ## and TWO sets of model predictions (mod and mod2) ## do for all models TaylorDiagram(mod.dat, obs = \"obs\", mod = c(\"mod\", \"mod2\"), group = \"model\") } # } if (FALSE) { # \\dontrun{ ## all models, by season TaylorDiagram(mod.dat, obs = \"obs\", mod = c(\"mod\", \"mod2\"), group = \"model\", type = \"season\") ## consider two groups (model/month). In this case all months are shown by model ## but are only differentiated by model. TaylorDiagram(mod.dat, obs = \"obs\", mod = \"mod\", group = c(\"model\", \"month\")) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests for trends using Theil-Sen estimates — TheilSen","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"Theil-Sen slope estimates tests trend.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"","code":"TheilSen( mydata, pollutant = \"nox\", deseason = FALSE, type = \"default\", avg.time = \"month\", statistic = \"mean\", percentile = NA, data.thresh = 0, alpha = 0.05, dec.place = 2, xlab = \"year\", lab.frac = 0.99, lab.cex = 0.8, x.relation = \"same\", y.relation = \"same\", data.col = \"cornflowerblue\", trend = list(lty = c(1, 5), lwd = c(2, 1), col = c(\"red\", \"red\")), text.col = \"darkgreen\", slope.text = NULL, cols = NULL, shade = \"grey95\", auto.text = TRUE, autocor = FALSE, slope.percent = FALSE, date.breaks = 7, date.format = NULL, plot = TRUE, silent = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"mydata data frame containing field date least one parameter trend test required; typically (necessarily) pollutant. pollutant parameter trend test required. Mandatory. deseason data de-deasonalized first? TRUE function stl used (seasonal trend decomposition using loess). Note TRUE missing data first imputed using Kalman filter Kalman smooth. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. avg.time Can “month” (default), “season” “year”. Determines time data averaged. Note “year”, six years required. “season” data split spring: March, April, May etc. Note December considered belonging winter following year. statistic Statistic used calculating monthly values. Default “mean”, can also “percentile”. See timeAverage details. percentile Single percentile value use statistic = \"percentile\" chosen. data.thresh data capture threshold use (%) aggregating data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. alpha confidence interval calculations slope. default 0.05. show 99\\ trend, choose alpha = 0.01 etc. dec.place number decimal places display trend estimate . default 2. xlab x-axis label, default \"year\". lab.frac Fraction along y-axis trend information printed , default 0.99. lab.cex Size text trend information. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. data.col Colour name data trend list containing information line width, line type line colour main trend line confidence intervals respectively. text.col Colour name slope/uncertainty numeric estimates slope.text text shown slope (default ‘units/year’). cols Predefined colour scheme, currently enabled \"greyscale\". shade colour used marking alternate years. Use “white” “transparent” remove shading. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. autocor autocorrelation considered trend uncertainty estimates? default FALSE. Generally, accounting autocorrelation increases uncertainty trend estimate — sometimes large amount. slope.percent slope slope uncertainties expressed percentage change per year? default FALSE slope expressed average units/year change e.g. ppb. Percentage changes can often confusing clearly defined. percentage change expressed 100 * (C.end/C.start - 1) / (end.year - start.year). C.start concentration start date C.end concentration end date. avg.time = \"year\" (end.year - start.year) total number years - 1. example, given concentration year 1 100 units percentage reduction 5%/yr, 5 years 75 units actual time span 6 years .e. year 1 used reference year. Things slightly different monthly values e.g. avg.time = \"month\", use total number months basis time span therefore able deal partial years. can slight differences %/yr trend estimate therefore, depending whether monthly annual values considered. date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . date.format option controls date format x-axis. TheilSen generally sets date format sensibly can situations user wishes control. format types see strptime. example, format date like “Jan-2012” set date.format = \"%b-%Y\". plot plot produced? FALSE can useful analysing data extract trend components plotting ways. silent FALSE function give updates trend-fitting progress. ... graphical parameters passed onto cutData lattice:xyplot. example, TheilSen passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"openair object. data component TheilSen output includes two subsets: main.data, monthly data res2 trend statistics. output <- TheilSen(mydata, \"nox\"), can extracted object$data$main.data object$data$res2, respectively. Note: case intercept, assumed y-axis crosses x-axis 1/1/1970.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"TheilSen function provides collection functions analyse trends air pollution data. TheilSen function flexible sense can applied data many ways e.g. day week, hour day wind direction. flexibility makes much easier draw inferences data e.g. strong downward trend concentration one wind sector another, trends one day week certain time day unexpected. data strongly seasonal, perhaps background site, pollutant ozone, important deseasonalise data (using option deseason = TRUE.Similarly, data increase, decrease, show sharp changes may better use smoothTrend. minimum 6 points required trend estimates made. Note! since version 0.5-11 openair uses Theil-Sen derive p values also slope. ensure consistency calculated p value trend parameters .e. slope estimates uncertainties. p value uncertainties calculated bootstrap simulations. Note symbols shown next trend estimate relate statistically significant trend estimate : p $<$ 0.001 = ***, p $<$ 0.01 = **, p $<$ 0.05 = * p $<$ 0.1 = $+$. code used TheilSen based Rand Wilcox. mostly relates Theil-Sen slope estimates uncertainties. modifications made take account correlated data based Kunsch (1989). basic function adapted take account auto-correlated data using block bootstrap simulations autocor = TRUE (Kunsch, 1989). follow suggestion Kunsch (1989) setting block length n(1/3) n length time series. slope estimate confidence intervals slope plotted numerical information presented.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"Helsel, D., Hirsch, R., 2002. Statistical methods water resources. US Geological Survey. Note good resource statistics applied environmental data. Hirsch, R. M., Slack, J. R., Smith, R. ., 1982. Techniques trend analysis monthly water-quality data. Water Resources Research 18 (1), 107-121. Kunsch, H. R., 1989. jackknife bootstrap general stationary observations. Annals Statistics 17 (3), 1217-1241. Sen, P. K., 1968. Estimates regression coefficient based Kendall's tau. Journal American Statistical Association 63(324). Theil, H., 1950. rank invariant method linear polynomial regression analysis, , ii, iii. Proceedings Koninklijke Nederlandse Akademie Wetenschappen, Series - Mathematical Sciences 53, 386-392, 521-525, 1397-1412. ... see also several Air Quality Expert Group (AQEG) reports use similar tests applied UK/European air quality data.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"David Carslaw trend code Rand Wilcox","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/TheilSen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tests for trends using Theil-Sen estimates — TheilSen","text":"","code":"# trend plot for nox TheilSen(mydata, pollutant = \"nox\") #> Taking bootstrap samples. Please wait. # trend plot for ozone with p=0.01 i.e. uncertainty in slope shown at # 99 % confidence interval if (FALSE) TheilSen(mydata, pollutant = \"o3\", ylab = \"o3 (ppb)\", alpha = 0.01) # \\dontrun{} # trend plot by each of 8 wind sectors if (FALSE) TheilSen(mydata, pollutant = \"o3\", type = \"wd\", ylab = \"o3 (ppb)\") # \\dontrun{} # and for a subset of data (from year 2000 onwards) if (FALSE) TheilSen(selectByDate(mydata, year = 2000:2005), pollutant = \"o3\", ylab = \"o3 (ppb)\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate summary statistics for air pollution data by year — aqStats","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"Calculate range air pollution-relevant statistics year.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"","code":"aqStats( mydata, pollutant = \"no2\", type = \"default\", data.thresh = 0, percentile = c(95, 99), transpose = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"mydata data frame containing date field hourly data. pollutant name pollutant e.g. pollutant = c(\"o3\", \"pm10\"). type type allows timeAverage() applied cases groups data need split function applied group. common example data multiple sites identified column representing site name e.g. type = \"site\". generally, type used date repeats particular grouping variable. data.thresh data capture threshold %. values calculated data capture period interest less value. data.thresh used example calculation daily mean values hourly data. less data.thresh percentage measurements available period, NA returned. percentile Percentile values calculate pollutant. transpose default return data frame columns representing statistics. transpose = TRUE results columns pollutant-site combination. ... arguments, currently unused.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"function calculates range common air pollution-specific statistics data frame. statistics calculated annual basis input assumed hourly data. function can cope several sites years e.g. using type = \"site\". user can control output setting transpose appropriately. Note input data assumed mass units e.g. ug/m3 species except CO (mg/m3). following statistics calculated: data.capture — percentage data capture full year. mean — annual mean. minimum — minimum hourly value. maximum — maximum hourly value. median — median value. max.daily — maximum daily mean. max.rolling.8 — maximum 8-hour rolling mean. max.rolling.24 — maximum 24-hour rolling mean. percentile.95 — 95th percentile. Note several percentiles can calculated. roll.8.O3.gt.100 — number days daily maximum rolling 8-hour mean ozone concentration >100 ug/m3. target value. roll.8.O3.gt.120 — number days daily maximum rolling 8-hour mean ozone concentration >120 ug/m3. Limit Value exceeded > 10 days year. AOT40 — accumulated amount ozone threshold value 40 ppb daylight hours growing season (April September). Note latitude longitude can also passed calculation. hours.gt.200 — number hours NO2 200 ug/m3. days.gt.50 — number days PM10 50 ug/m3. rolling means, user can supply option align, can \"centre\" (default), \"left\" \"right\". See rollingMean details. can small discrepancies AURN due treatment rounding data. aqStats function round, whereas AURN data can rounded several stages calculations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/aqStats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate summary statistics for air pollution data by year — aqStats","text":"","code":"## Statistics for 2004. NOTE! these data are in ppb/ppm so the ## example is for illustrative purposes only aqStats(selectByDate(mydata, year = 2004), pollutant = \"no2\") #> # A tibble: 1 × 15 #> # Groups: default, pollutant, year [1] #> default pollutant year date dat.cap mean min max median #> #> 1 01 Janua… no2 2004 2004-01-01 00:00:00 99.8 55.0 0 185 51 #> # ℹ 6 more variables: max_daily , roll_8_max , roll_24_max , #> # percentile.95 , percentile.99 , hours "},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":null,"dir":"Reference","previous_headings":"","what":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"Bin variable calculate mean uncertainties mean","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"","code":"binData(mydata, bin = \"nox\", uncer = \"no2\", n = 40, interval = NA, breaks = NA)"},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"mydata Name data frame process. bin name column divide intervals uncer name column mean, lower upper uncertainties calculated interval bin. n number intervals split bin . interval interval used binning data. breaks User specified breaks use binning.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"Returns summarised data frame new columns mean upper / lower 95 percent confidence intervals mean.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"function summarises data intervals calculates mean bootstrap 95 % confidence intervals mean chosen variable data frame. numeric variables summarised mean intervals. three options binning. default bon bin 40 intervals. Second, user can choose binning interval e.g. interval = 5. Third, user can supply breaks use binning intervals.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/binData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bin data, calculate mean and bootstrap 95 % confidence interval in the mean — binData","text":"","code":"# how does nox vary by intervals of wind speed? results <- binData(mydata, bin = \"ws\", uncer = \"nox\") # easy to plot this using ggplot2 if (FALSE) { # \\dontrun{ library(ggplot2) ggplot(results, aes(ws, mean, ymin = min, ymax = max)) + geom_pointrange() } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":null,"dir":"Reference","previous_headings":"","what":"Bootsrap confidence intervals in the mean — bootMeanDF","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"utility function calculation uncertainty intervals mean vector. function removes missing data calculation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"","code":"bootMeanDF(x, conf.int = 0.95, B = 1000)"},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"x vector mean bootstrap confidence intervals mean calculated conf.int confidence interval; default = 0.95. B number bootstrap simulations","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"Returns data frame mean, lower uncertainty, upper uncertainty number values used calculation","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/bootMeanDF.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bootsrap confidence intervals in the mean — bootMeanDF","text":"","code":"test <- rnorm(20, mean = 10) bootMeanDF(test) #> mean min max n #> Mean 9.959414 9.591018 10.3094 20"},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"Given hourly NOX NO2 roadside site hourly NOX, NO2 O3 background site function estimate emissions ratio NO2/NOX — level primary NO2","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"","code":"calcFno2(input, tau = 60, user.fno2, main = \"\", xlab = \"year\", ...)"},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"input data frame following fields. nox andno2 (roadside NOX NO2 concentrations), back_nox, back_no2 back_o3 (hourly background concentrations pollutant). addition temp (temperature degrees Celsius) cl (cloud cover Oktas). Note temp cl available, typical means values 11 deg. C cloud = 3.5 used. tau Mixing time scale. unlikely user need adjust . See details . user.fno2 User-supplied f-NO2 fraction e.g. 0.1 NO2/NOX ratio 10% volume. user.no2 applied whole time series useful testing \"\" questions. main Title plot required. xlab x-axis label. ... Arguments passed scatterPlot mydata data frame containing least two numeric variables plot. x Name x-variable plot. Note x can date field factor. example, x can one openair built types \"year\" \"season\". y Name numeric y-variable plot. z Name numeric z-variable plot method = \"scatter\" method = \"level\". Note method = \"scatter\" points coloured according continuous colour scale, whereas method = \"level\" surface coloured. method Methods include “scatter” (conventional scatter plot), “hexbin” (hexagonal binning using hexbin package). “level” binned smooth surface plot “density” (2D kernel density estimates). group grouping variable use, . Setting variable data frame effect plotting several series panel using different symbols/colours etc. set variable character factor, categories factor levels used directly. set numeric variable, split variable quantiles. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". See function timeAverage details . option se useful one method number points plotted reduced .e. choosing longer averaging time. data.thresh data capture threshold use (\\ data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". statistic statistic apply aggregating data; default mean. Can one \"mean\", \"max\", \"min\", \"median\", \"frequency\", \"sd\", \"percentile\". Note \"sd\" standard deviation \"frequency\" number (frequency) valid records period. \"percentile\" percentile level (\\ \"percentile\" option - see . used avg.time = \"default\". percentile percentile level percent used statistic = \"percentile\" aggregating data avg.time. default 95. used avg.time = \"default\". type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. smooth smooth line fitted data TRUE; optionally 95 percent confidence intervals shown. method = \"level\" smooth surface fitted binned data. spline smooth spline fitted data TRUE. particularly useful fewer data points connection line sequence points required. linear linear model fitted data TRUE; optionally 95 percent confidence intervals shown. equation line R2 value also shown. ci confidence intervals smooth/linear fit shown? mod.line TRUE three lines added scatter plot help inform model evaluation. 1:1 line solid 1:0.5 1:2 lines dashed. Together lines help show close group points 1:1 relationship also show points within factor two (FAC2). mod.line appropriately transformed x y axes log scale. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") plot.type lattice plot type. Can “p” (points — default), “l” (lines) “b” (lines points). key key drawn? default TRUE. key.title title key (used). key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. strip strip drawn? default TRUE. log.x x-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. log.y y-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. x.inc x-interval used binning data method = \"level\". y.inc y-interval used binning data method = \"level\". limits method = \"level\" function best choose sensible limits automatically. However, circumstances user wish set different ones. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. windflow option allows scatter plot show wind speed/direction shows arrow. option list e.g. windflow = list(col = \"grey\", lwd = 2, scale = 0.1). option requires wind speed (ws) wind direction (wd) available. maximum length arrow plotted fraction plot dimension longest arrow scale plot x-y dimension. Note, plot size adjusted manually user re-plotted ensure correct wind angle. list may contain options panel.arrows lattice package. useful options include length, controls length arrow head angle, controls angle arrow head. option works best many data ensure -plotting become problem. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. k Smoothing parameter supplied gam fitting smooth surface method = \"level\". dist plotting smooth surfaces (method = \"level\" smooth = TRUE, dist controls far original data predictions made. See exclude..far mgcv package. Data first transformed unit square. Values 0 1. map base map drawn? option development. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"principal purpose function estimate level primary (direct) NO2 road vehicles. hourly data NOX, NO2 O3 available, total oxidant method Clapp Jenkin (2001) can used. roadside O3 measurements available see linearRelation() details estimate primary NO2 fraction. absence roadside O3 measurements, rather problematic calculate fraction primary NO2. Carslaw Beevers (2005c) developed approach based linearRelation() analysis roadside background measurements. increment roadside NO2 concentrations primarily determined direct emissions NO2 availability One react form NO2. method aims quantify amount NO2 formed two processes seeking optimum level primary NO2 gives least error. Test data provided https://davidcarslaw.github.io/openair/.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"Clapp, L.J., Jenkin, M.E., 2001. Analysis relationship ambient levels O3, NO2 function NOX UK. Atmospheric Environment 35 (36), 6391-6405. Carslaw, D.C. N Carslaw (2007). Detecting characterising small changes urban nitrogen dioxide concentrations. Atmospheric Environment. Vol. 41, 4723-4733. Carslaw, D.C., Beevers, S.D. M.C. Bell (2007). Risks exceeding hourly EU limit value nitrogen dioxide resulting increased road transport emissions primary nitrogen dioxide. Atmospheric Environment 41 2073-2082. Carslaw, D.C. (2005a). Evidence increasing NO2/NOX emissions ratio road traffic emissions. Atmospheric Environment, 39(26) 4793-4802. Carslaw, D.C. Beevers, S.D. (2005b). Development urban inventory road transport emissions NO2 comparison estimates derived ambient measurements. Atmospheric Environment, (39): 2049-2059. Carslaw, D.C. Beevers, S.D. (2005c). Estimations road vehicle primary NO2 exhaust emission fractions using monitoring data London. Atmospheric Environment, 39(1): 167-177. Carslaw, D. C. S. D. Beevers (2004). Investigating Potential Importance Primary NO2 Emissions Street Canyon. Atmospheric Environment 38(22): 3585-3594. Carslaw, D. C. S. D. Beevers (2004). New Directions: road vehicle emissions legislation consider primary NO2? Atmospheric Environment 38(8): 1233-1234.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calcFno2.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate NO2/NOX emission ratios from monitoring data — calcFno2","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate percentile values from a time series — calcPercentile","title":"Calculate percentile values from a time series — calcPercentile","text":"Calculates multiple percentile values time series, flexible time aggregation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate percentile values from a time series — calcPercentile","text":"","code":"calcPercentile( mydata, pollutant = \"o3\", avg.time = \"month\", percentile = 50, data.thresh = 0, start = NA )"},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate percentile values from a time series — calcPercentile","text":"mydata data frame data date field format Date POSIXct. Must one variable apply calculations . pollutant Name variable process. Mandatory. avg.time Averaging period use. See timeAverage() details. percentile vector percentile values. example percentile = 50 median values, percentile = c(5, 50, 95 multiple percentile values. data.thresh Data threshold apply aggregating data. See timeAverage() details. start Start date use - see timeAverage() details.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate percentile values from a time series — calcPercentile","text":"Returns data frame new columns percentile level. New columns given names like percentile.95 e.g. percentile = 95 chosen. See examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate percentile values from a time series — calcPercentile","text":"utility function calculate percentiles used , example, timePlot. Given data frame date field one numeric variable, percentiles calculated.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate percentile values from a time series — calcPercentile","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calcPercentile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate percentile values from a time series — calcPercentile","text":"","code":"# 95th percentile monthly o3 concentrations percentiles <- calcPercentile(mydata, pollutant =\"o3\", avg.time = \"month\", percentile = 95) head(percentiles) #> date percentile.95 #> 1 1998-01-01 14 #> 2 1998-02-01 7 #> 3 1998-03-01 15 #> 4 1998-04-01 20 #> 5 1998-05-01 25 #> 6 1998-06-01 15 # 5, 50, 95th percentile monthly o3 concentrations if (FALSE) { # \\dontrun{ percentiles <- calcPercentile(mydata, pollutant =\"o3\", avg.time = \"month\", percentile = c(5, 50, 95)) head(percentiles) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot time series values in a conventional calendar format — calendarPlot","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"function plot data month laid conventional calendar format. main purpose help rapidly visualise potentially complex data familiar way. Users can also choose show daily mean wind vectors wind speed direction available.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"","code":"calendarPlot( mydata, pollutant = \"nox\", year = 2003, month = 1:12, type = \"default\", annotate = \"date\", statistic = \"mean\", cols = \"heat\", limits = c(0, 100), lim = NULL, col.lim = c(\"grey30\", \"black\"), col.arrow = \"black\", font.lim = c(1, 2), cex.lim = c(0.6, 1), digits = 0, data.thresh = 0, labels = NA, breaks = NA, w.shift = 0, w.abbr.len = 1, remove.empty = TRUE, main = NULL, key.header = \"\", key.footer = \"\", key.position = \"right\", key = TRUE, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"mydata data frame minimally containing date least one numeric variable. date either Date format class POSIXct. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". year Year plot e.g. year = 2003. supplied data potentially spanning several years plotted. month certain month required. default function plot entire year even months missing. plot certain months use month option month numeric 1:12 e.g. month = c(1, 12) plot January December. type yet implemented. annotate option controls appears day calendar. Can : \"date\" — shows day month; \"wd\" — shows vector-averaged wind direction, \"ws\" — shows vector-averaged wind direction scaled wind speed. Finally can “value” shows daily mean value. statistic Statistic passed timeAverage(). Note statistic = \"max\" annotate \"ws\" \"wd\", hour corresponding maximum concentration polluant used provide associated ws wd maximum daily ws wd. cols Colours used plotting. See openColours() details. limits Use option manually set colour scale limits. useful case need two plots consistent scale needed . Set limits cover maximum range data plots interest. example, one plot data covering 0–60 another 0–100, set limits = c(0, 100). Note data ignored outside limits range. lim threshold value help differentiate values lim. used annotate = \"value\". See next options control labels used. col.lim annotation concentration labels day. first sets colour text lim second sets colour text lim. col.arrow colour annotated wind direction / wind speed arrows. font.lim annotation concentration labels day. first sets font text lim second sets font text lim. Note font = 1 normal text font = 2 bold text. cex.lim annotation concentration labels day. first sets size text lim second sets size text lim. digits number digits used display concentration values annotate = \"value\". data.thresh Data capture threshold passed timeAverage(). example, data.thresh = 75 means least 75\\ available day value calculate, else data removed. labels categorical scale defined using breaks, labels can used override default category labels, e.g., labels = c(\"good\", \"bad\", \"bad\"). Note one less label break. breaks categorical scale required breaks used. example, breaks = c(0, 50, 100, 1000). case “good” corresponds values 0 50 . Users set maximum value breaks exceed maximum data value ensure within maximum final range e.g. 100–1000 case. w.shift Controls order days week. default plot shows Saturday first (w.shift = 0). change starts Monday example, set w.shift = 2, . w.abbr.len default (1) abbreviates days week single letter (e.g., English, S/S/M/T/W/T/F). w.abbr.len defines number letters abbreviate . example, w.abbr.len = 3 abbreviate \"Monday\" \"Mon\". remove.empty months data present removed? Default TRUE. main plot title; default pollutant year. key.header Adds additional text/labels scale key. example, passing calendarPlot(mydata, key.header = \"header\", key.footer = \"footer\") adds addition text scale key. arguments passed drawOpenKey() via quickText(), applying auto.text argument, handle formatting. key.footer see key.header. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey(). See drawOpenKey() details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract calendar plot components plotting ways. ... graphical parameters passed onto lattice function lattice::levelplot(), common axis title labelling options (xlab, ylab, main) passed via quickText() handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"calendarPlot() plot data conventional calendar format, .e., month day week. Daily statistics calculated using timeAverage(), default calculate daily mean concentration. wind direction available possible plot wind direction vector day. useful getting feel meteorological conditions affect pollutant concentrations. Note hourly higher time resolution supplied, calendarPlot() calculate daily averages using timeAverage(), ensures wind directions vector-averaged. wind speed also available, setting option annotate = \"ws\" plot wind vectors whose length scaled wind speed. Thus information daily mean wind speed direction available. also possible plot categorical scales. useful , example, air quality index defines concentrations bands, e.g., \"good\", \"poor\". cases users must supply labels corresponding breaks. Note possible pre-calculate concentrations way passing data calendarPlot(). example rollingMean() used calculate rolling 8-hour mean concentrations. data can passed calendarPlot() statistic = \"max\" chosen, plot maximum daily 8-hour mean concentrations.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/calendarPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot time series values in a conventional calendar format — calendarPlot","text":"","code":"# basic plot calendarPlot(mydata, pollutant = \"o3\", year = 2003) # show wind vectors calendarPlot(mydata, pollutant = \"o3\", year = 2003, annotate = \"wd\") if (FALSE) { # \\dontrun{ # show wind vectors scaled by wind speed and different colours calendarPlot(mydata, pollutant = \"o3\", year = 2003, annotate = \"ws\", cols = \"heat\" ) # show only specific months with selectByDate calendarPlot(selectByDate(mydata, month = c(3, 6, 10), year = 2003), pollutant = \"o3\", year = 2003, annotate = \"ws\", cols = \"heat\" ) # categorical scale example calendarPlot(mydata, pollutant = \"no2\", breaks = c(0, 50, 100, 150, 1000), labels = c(\"Very low\", \"Low\", \"High\", \"Very High\"), cols = c(\"lightblue\", \"green\", \"yellow\", \"red\"), statistic = \"max\" ) # UK daily air quality index pm10.breaks <- c(0, 17, 34, 50, 59, 67, 75, 84, 92, 100, 1000) calendarPlot(mydata, \"pm10\", year = 1999, breaks = pm10.breaks, labels = c(1:10), cols = \"daqi\", statistic = \"mean\", key.header = \"DAQI\" ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"function enhances conditionalQuantile() also considering variables vary intervals. Conditional quantiles useful model evaluation, provide direct information variables change time. example, conditional quantile plot ozone concentrations may show low concentrations ozone tend -predicted. However, cause -prediction can difficult determine. However, considering well model predicts variables intervals, insight can gained underlying reasons model performance poor.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"","code":"conditionalEval( mydata, obs = \"obs\", mod = \"mod\", var.obs = \"var.obs\", var.mod = \"var.mod\", type = \"default\", bins = 31, statistic = \"MB\", xlab = \"predicted value\", ylab = \"statistic\", col = brewer.pal(5, \"YlOrRd\"), col.var = \"Set1\", var.names = NULL, auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"mydata data frame containing field obs mod representing observed modelled values. obs name observations mydata. mod name predictions (modelled values) mydata. var.obs variable observations statistics calculated. Can length one e.g. var.obs = c(\"nox.obs\", \"ws.obs\"). Note including variables reduce number data available plot due need non-missing data variables. var.mod variable predictions statistics calculated. Can length one e.g. var.obs = c(\"nox.obs\", \"ws.obs\"). type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. \"season\", \"year\", \"weekday\" . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. bins Number bins used calculating different quantile levels. statistic Statistic(s) plotted. Can “MB”, “NMB”, “r”, “COE”, “MGE”, “NMGE”, “RMSE” “FAC2”, described modStats. statistics chosen, calculated var.mod var.mod. statistic can also value can supplied cutData. example, statistic = \"season\" show model performance varies season across distribution predictions might highlight high concentrations NOx model tends underestimate concentrations periods mostly occur winter. statistic can also another variable data frame — see cutData information. special case statistic = \"cluster\" clusters calculated using trajCluster. xlab label x-axis, default “predicted value”. ylab label y-axis, default “observed value”. col Colours used plotting uncertainty bands median line. Must length 5 . col.var Colours additional variables compared. See openColours details. var.names Variable names shown plot plotting var.obs var.mod. auto.text Either TRUE (default) FALSE. TRUE titles axis labels etc. automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto conditionalQuantile cutData. example, conditionalQuantile passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"conditionalEval function provides information variables vary across intervals shown conditional quantile plot. two types variable can considered setting value statistic. First, statistic can another variable data frame. case plot show different proportions statistic across range predictions. example statistic = \"season\" show interval mod proportion predictions spring, summer, autumn winter. useful model performance worse example high concentrations mod knowing tend occur particular season etc. can helpful trying understand model fails. See cutData() details types variable can statistic. Another example statistic = \"ws\" (wind speed available data frame), split wind speed four quantiles plot proportions . Second, conditionalEval can simultaneously plot model performance observed/predicted variable pairs according different model evaluation statistics. statistics derive modStats() function include “MB”, “NMB”, “r”, “COE”, “MGE”, “NMGE”, “RMSE” “FAC2”. one statistic can supplied e.g. statistic = c(\"NMB\", \"COE\"). Bootstrap samples taken corresponding values variables plotted statistics 95\\ intervals calculated. case, model performance variables shown across intervals mod, rather just values single variables. second case model need provide observed/predicted pairs variables. example, model may provide predictions NOx wind speed (also observations available). conditionalEval function show well variables predicted intervals main variables assessed conditional quantile e.g. ozone. case, values supplied var.obs (observed values variables) var.mod (modelled values variables). example, consider well model predicts NOx wind speed var.obs = c(\"nox.obs\", \"ws.obs\") var.mod = c(\"nox.mod\", \"ws.mod\") supplied (assuming nox.obs, nox.mod, ws.obs, ws.mod present data frame). analysis show example, ozone concentrations -predicted, model may also shown -predict concentrations NOx time, -predict wind speeds. information can thus help identify underlying causes poor model performance. example, -prediction wind speed result higher surface NOx concentrations lower ozone concentrations. Similarly wind speed predictions good NOx predicted might suggest -estimate NOx emissions. One additional variables can plotted. special case statistic = \"cluster\". case data frame provided contains cluster calculated trajCluster() importTraj(). Alternatively users supply pre-calculated clusters. calculations can useful showing whether certain back trajectory clusters associated poor (good) model performance. Note case statistic = \"cluster\" fewer data points used analysis compared ordinary statistics trajectories available every three hours. Also note statistic = \"cluster\" used together ordinary model evaluation statistics MB. output bar chart showing proportion interval mod cluster number. Far insight can gained model performance conditioning using type. example, type = \"season\" plot conditional quantiles associated model performance statistics variables season. type can also factor character field e.g. representing different models used. See Wilks (2005) details conditional quantile plots.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"Wilks, D. S., 2005. Statistical Methods Atmospheric Sciences, Volume 91, Second Edition (International Geophysics), 2nd Edition. Academic Press.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalEval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Conditional quantile estimates with additional variables for model evaluation — conditionalEval","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional quantile estimates for model evaluation — conditionalQuantile","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Function calculate conditional quantiles flexible conditioning. function use model evaluation generally help better understand forecast predictions well agree observations.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"","code":"conditionalQuantile( mydata, obs = \"obs\", mod = \"mod\", type = \"default\", bins = 31, min.bin = c(10, 20), xlab = \"predicted value\", ylab = \"observed value\", col = brewer.pal(5, \"YlOrRd\"), key.columns = 2, key.position = \"bottom\", auto.text = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"mydata data frame containing field obs mod representing observed modelled values. obs name observations mydata. mod name predictions (modelled values) mydata. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. bins Number bins used calculating different quantile levels. min.bin minimum number points required estimates 25/75th 10/90th percentiles. xlab label x-axis, default “predicted value”. ylab label y-axis, default “observed value”. col Colours used plotting uncertainty bands median line. Must length 5 . key.columns Number columns used key. key.position Location key e.g. “top”, “bottom”, “right”, “left”. See lattice xyplot details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels etc. automatically try format pollutant names units properly e.g. subscripting `2' NO2. ... graphical parameters passed onto cutData lattice:xyplot. example, conditionalQuantile passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Conditional quantiles useful way considering model performance observations continuous measurements (Wilks, 2005). conditional quantile plot splits data evenly spaced bins. predicted value bin e.g. 0 10~ppb corresponding values observations identified median, 25/75th 10/90 percentile (quantile) calculated bin. data plotted show values vary across bins. time series observations predictions agree precisely median value predictions equal observations bin. conditional quantile plot differs quantile-quantile plot (Q-Q plot) often used compare observations predictions. Q-Q~plot separately considers distributions observations predictions, whereas conditional quantile uses corresponding observations particular interval predictions. Take example two time series, first series real observations second lagged time series observations representing predictions. two time series identical (nearly identical) distributions (e.g. median, minimum maximum). Q-Q plot show straight line showing perfect agreement, whereas conditional quantile . interval predictions corresponding observations now different values. Plotting data way shows well predictions agree observations can help reveal many useful characteristics well model predictions agree observations — across full distribution values. single plot can therefore convey considerable amount information concerning model performance. conditionalQuantile function openair allows conditional quantiles considered flexible way e.g. considering vary season. function requires data frame consisting column observations column predictions. observations split bins according values predictions. median prediction line together 25/75th 10/90th quantile values plotted together line showing “perfect” model. Also shown histogram predicted values (shaded grey) histogram observed values (shown blue line). Far insight can gained model performance conditioning using type. example, type = \"season\" plot conditional quantiles season. type can also factor character field e.g. representing different models used. See Wilks (2005) details examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"Murphy, . H., B.G. Brown Y. Chen. (1989) Diagnostic Verification Temperature Forecasts, Weather Forecasting, Volume: 4, Issue: 4, Pages: 485-501. Wilks, D. S., 2005. Statistical Methods Atmospheric Sciences, Volume 91, Second Edition (International Geophysics), 2nd Edition. Academic Press.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/conditionalQuantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conditional quantile estimates for model evaluation — conditionalQuantile","text":"","code":"## make some dummy prediction data based on 'nox' mydata$mod <- mydata$nox * 1.1 + mydata$nox * runif(1:nrow(mydata)) # basic conditional quantile plot ## A \"perfect\" model is shown by the blue line ## predictions tend to be increasingly positively biased at high nox, ## shown by departure of median line from the blue one. ## The widening uncertainty bands with increasing NOx shows that ## hourly predictions are worse for higher NOx concentrations. ## Also, the red (median) line extends beyond the data (blue line), ## which shows in this case some predictions are much higher than ## the corresponding measurements. Note that the uncertainty bands ## do not extend as far as the median line because there is insufficient # to calculate them conditionalQuantile(mydata, obs = \"nox\", mod = \"mod\") ## can split by season to show seasonal performance (not very ## enlightening in this case - try some real data and it will be!) if (FALSE) { # \\dontrun{ conditionalQuantile(mydata, obs = \"nox\", mod = \"mod\", type = \"season\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlation matrices with conditioning — corPlot","title":"Correlation matrices with conditioning — corPlot","text":"Function draw visualise correlation matrices using lattice. primary purpose tool exploratory data analysis. Hierarchical clustering used group similar variables.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlation matrices with conditioning — corPlot","text":"","code":"corPlot( mydata, pollutants = NULL, type = \"default\", cluster = TRUE, method = \"pearson\", use = \"pairwise.complete.obs\", dendrogram = FALSE, lower = FALSE, cols = \"default\", r.thresh = 0.8, text.col = c(\"black\", \"black\"), auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlation matrices with conditioning — corPlot","text":"mydata data frame consist numeric columns. pollutants names data-series mydata plotted corPlot. default option NULL alternative “” use available valid (numeric) data. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. cluster data ordered according cluster analysis. TRUE hierarchical clustering applied correlation matrices using hclust group similar variables together. many variables clustering can greatly assist interpretation. method correlation method use. Can “pearson”, “spearman” “kendall”. use handle missing values cor function. default \"pairwise.complete.obs\". Care taken choice handle missing data considering pair-wise correlations. dendrogram dendrogram plotted? TRUE dendrogram shown right plot. Note work type = \"default\". lower lower triangle plotted? cols Colours used plotting. Options include “default”, “increment”, “heat”, “spectral”, “hue”, “greyscale” user defined (see openColours details). r.thresh Values greater r.thresh shown bold type. helps highlight high correlations. text.col colour text used show correlation values. first value controls colour negative correlations second positive. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract corPlot components plotting ways. ... graphical parameters passed onto lattice:levelplot, common axis title labelling options (xlab, ylab, main) passed via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correlation matrices with conditioning — corPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correlation matrices with conditioning — corPlot","text":"corPlot function plots correlation matrices. implementation relies heavily shown Sarkar (2007), extensions. Correlation matrices effective way understating relationships many variables. corPlot shows correlation coded three ways: shape (ellipses), colour numeric value. ellipses can thought visual representations scatter plot. perfect positive correlation line 45 degrees positive slope drawn. zero correlation shape becomes circle. See examples . many different variables can difficult see relationships variables, .e., variables tend behave like one another. reason hierarchical clustering applied correlation matrices group variables similar one another (cluster = TRUE). clustering chosen also possible add dendrogram using option dendrogram = TRUE. Note dendrogramscan plotted type = \"default\" .e. single panel. dendrogram can also recovered plot object plotted clearly; see examples . also possible use openair type option condition data many flexible ways, although may become difficult visualise many panels.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correlation matrices with conditioning — corPlot","text":"Sarkar, D. (2007). Lattice Multivariate Data Visualization R. New York: Springer. Friendly, M. (2002). Corrgrams : Exploratory displays correlation matrices. American Statistician, 2002(4), 1-16. doi:10.1198/000313002533","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlation matrices with conditioning — corPlot","text":"David Carslaw — mostly based code contained Sarkar (2007)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/corPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correlation matrices with conditioning — corPlot","text":"","code":"## basic corrgram plot corPlot(mydata) ## plot by season ... and so on corPlot(mydata, type = \"season\") ## recover dendrogram when cluster = TRUE and plot it res <-corPlot(mydata) plot(res$clust) if (FALSE) { # \\dontrun{ ## a more interesting are hydrocarbon measurements hc <- importAURN(site = \"my1\", year = 2005, hc = TRUE) ## now it is possible to see the hydrocarbons that behave most ## similarly to one another corPlot(hc) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to split data in different ways for conditioning — cutData","title":"Function to split data in different ways for conditioning — cutData","text":"Utility function split data frames various ways conditioning plots. Users generally expected call function directly. Widely used many openair functions usually option type.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to split data in different ways for conditioning — cutData","text":"","code":"cutData( x, type = \"default\", hemisphere = \"northern\", n.levels = 4, start.day = 1, is.axis = FALSE, local.tz = NULL, latitude = 51, longitude = -0.5, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to split data in different ways for conditioning — cutData","text":"x data frame containing field date. type string giving way data frame split. Pre-defined values : “default”, “year”, “hour”, “month”, “season”, “weekday”, “site”, “weekend”, “monthyear”, “daylight”, “dst” (daylight saving time). type can also name numeric factor. numeric column name supplied cutData split data four quantiles. Factors levels used split data without adjustment. hemisphere Can \"northern\" \"southern\", used split data seasons. n.levels Number quantiles split numeric data . start.day day week type = \"weekday\" start ? user can change start day supplying integer 0 6. Sunday = 0, Monday = 1, ... example start weekday plots Saturday, choose start.day = 6. .axis logical (TRUE/FALSE), used request shortened cut labels axes. local.tz Used identifying whether date daylight savings time (DST) applied . Examples include local.tz = \"Europe/London\", local.tz = \"America/New_York\" .e. time zones assume DST. https://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones shows time zones valid systems. important original data GMT (UTC) fixed offset GMT. See import openair manual information import data ensure DST applied. latitude decimal latitude used type = \"daylight\". longitude decimal longitude. Note locations west Greenwich negative. ... additional parameters passed next function(s).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to split data in different ways for conditioning — cutData","text":"Returns data frame column cond defined type.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to split data in different ways for conditioning — cutData","text":"section give brief description define levels type. Note time dependent types require column date. \"default\" split data describe levels date range format \"day month year\". \"year\" splits data year. \"month\" splits data month year. \"hour\" splits data hour day. \"monthyear\" splits data year month. differs month level defined month data set. useful sometimes show ordered sequence months data set starts half way year; rather starting January. \"weekend\" splits data weekday weekend. \"weekday\" splits data day week - ordered start Monday. \"season\" splits data season. northern hemisphere winter = December, January, February; spring = March, April, May etc. definitions change hemisphere = \"southern\". \"seasonyear (\"yearseason\") split data year-season intervals, keeping months season together. example, December 2010 considered part winter 2011 (January February 2011). makes easier consider contiguous seasons. contrast, type = \"season\" just split data four seasons regardless year. \"daylight\" splits data relative estimated sunrise sunset give either daylight nighttime. cut made cutDaylight conveniently accessed via cutData, e.g. cutData(mydata, type = \"daylight\", latitude = .latitude, longitude = .longitude). daylight estimation, valid dates 1901 2099, made using measurement location, date, time astronomical algorithms estimate relative positions Sun measurement location Earth's surface, based NOAA methods. Measurement location set using latitude (+ North; - South) longitude (+ East; - West). \"dst\" split data hours daylight saving time (DST) hours appropriate time zones. option \"dst\" also requires local time zone given e.g. local.tz = \"Europe/London\", local.tz = \"America/New_York\". two periods local time. main purpose option test whether shift diurnal profile DST non-DST hours compared. option particularly useful timeVariation function. example, close source road vehicle emissions, `rush-hour' tend occur local time throughout year e.g. 8 5 pm. Therefore, comparing non-DST hours DST hours tend show similar diurnal patterns (least timing peaks, magnitude) expressed local time. contrast variable wind speed temperature show clear shift expressed local time. essence, option used timeVariation may help determine whether variation pollutant driven man-made emissions natural processes. \"wd\" splits data 8 wind sectors requires column wd: \"NE\", \"E\", \"SE\", \"S\", \"SW\", \"W\", \"NW\", \"N\". \"ws\" splits data 8 quantiles wind speed requires column ws. \"site\" splits data site therefore requires column site. Note date-based types e.g. month/year derived column date. user already column name one date-based types used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to split data in different ways for conditioning — cutData","text":"David Carslaw (cutData) Karl Ropkins (cutDaylight)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/cutData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to split data in different ways for conditioning — cutData","text":"","code":"## split data by day of the week mydata <- cutData(mydata, type = \"weekday\")"},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":null,"dir":"Reference","previous_headings":"","what":"Scale key handling for openair — drawOpenKey","title":"Scale key handling for openair — drawOpenKey","text":"General function producing scale keys openair functions. function crude modification draw.colorkey function developed Deepayan Sarkar part lattice package, allows additional key labelling added, provides additional control appearance scaling.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scale key handling for openair — drawOpenKey","text":"","code":"drawOpenKey(key, draw = FALSE, vp = NULL)"},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scale key handling for openair — drawOpenKey","text":"key List defining scale key structure produced. options identical original draw.colorkey function. Original draw.colorkey options: space location scale key (\"left\", \"right\", \"top\" \"bottom\"). Defaults \"right\". col vector colours, used scale key. numeric vector specifying colors change. Must length 1 col vector. labels character vector labelling values, commonly, list describing characteristics labels. list may include components labels, , cex, col, rot, font, fontface fontfamily. tick.number approximate number ticks. width width key. height height key. Note: width height refer key dimensions. height length key along plot axis positioned , width length perpendicular . Additional options include: header character vector extra text added key, list describing characteristics header. list may include components header, character vector header labels, tweaks, list local controls, e.g. 'gap' 'balance' spacing relative scale footer, respectively, auto.text, TRUE/FALSE option apply quickText, slot, numeric vector setting size text boxes header text placed . footer header labels scale key. Notes: header footer formatting can set locally, instead matched set labels. drawOpenKey allows six additional labels (three three scale key). additional text ignored. tweak, auto.text, slot header footer sets options uniformly. also overwrites anything header /footer. fit fit method applied header, scale key footer placing scale key left right plot. Options include: '', 'soft' 'scale'. default '' fits header, key footer height range. alternative 'scale' fits key within height. (means keys keep proportions relative main plot regardless positioning header footer may exceed plot dimensions height /slots large. plot.style character vector key plotting style instructions: Options currently include: 'paddle', 'ticks' 'border'. 'paddle' applies incremental paddle layout used winRose. 'ticks' places ticks labels scale key. 'border' places border scale key. combination may used none set, scale key defaults c(\"ticks\", \"border\") plotting operations c(\"paddle\") windRose. draw Option return key object plot directly. default, FALSE, always used within openair calls. vp View port used plotting key. default, NULL, always used within openair calls. (Note: drawOpenKey crude modification lattice::draw.colorkey, provides labelling options openair plot scale keys. aspects function development may subject change. Therefore, recommended use parent openair function controls, e.g. key.position, key.header, key.footer options, possible. drawOpenKey may obviously used plots recommended draw.colorkey used wherever type additional scale labelling required.)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scale key handling for openair — drawOpenKey","text":"function modification lattice::draw.colorkey returns scale key using similar mechanism used original function developed Deepayan Sarkar.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Scale key handling for openair — drawOpenKey","text":"drawOpenKey function produces scale keys openair functions. drawOpenKey options identical lattice::draw.colorkey. example, scale key size position controlled via height, width space. Likewise, axis labelling can set formatted labels. See draw.colorkey details. Additional scale labelling may added scale using header footer options within key. openair functions, automatic text formatting can enabled via auto.key. (Note: Currently, formatting header footer text fixed style labels (scale axis) defined locally.) relationship header, footer scale key can controlled using fit options. can set key$fit apply uniform control individually key$header$fit /key$footer$fit control locally. appearance scale can controlled using plot.style.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Scale key handling for openair — drawOpenKey","text":"gratefully acknowledge considerable help advice Deepayan Sarkar.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Scale key handling for openair — drawOpenKey","text":"Deepayan Sarkar (2010). lattice: Lattice Graphics. R package version 0.18-5. http://r-forge.r-project.org/projects/lattice/","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Scale key handling for openair — drawOpenKey","text":"draw.colorkey part lattice package, developed Deepayan Sarkar. Additional modifications Karl Ropkins.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/drawOpenKey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scale key handling for openair — drawOpenKey","text":"","code":"########## #example 1 ########## #paddle style scale key used by windRose windRose(mydata,) #adding text and changing style and position via key #note: #some simple key control also possible directly #For example, below does same as #windRose(mydata, key.position=\"right\") windRose(mydata, key =list(space=\"right\") ) #however: #more detailed control possible working with #key and drawOpenKey. For example, windRose(mydata, key = list(header=\"Title\", footer=\"wind speed\", plot.style = c(\"ticks\", \"border\"), fit = \"all\", height = 1, space = \"top\") )"},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":null,"dir":"Reference","previous_headings":"","what":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Function(s) import various ADMS file types openair. Currently handles \".met\", \".bgd\", \".mop\" \".pst\" file structures. Uses utils::read.csv() read data, format R openair apply file structure testing.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"","code":"importADMS( file = file.choose(), file.type = \"unknown\", drop.case = TRUE, drop.input.dates = TRUE, keep.units = TRUE, simplify.names = TRUE, test.file.structure = TRUE, drop.delim = TRUE, add.prefixes = TRUE, names = NULL, all = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"file ADMS file imported. Default, file.choose() opens browser. Use utils::read.csv() also allows readable text-mode connection url (although options currently fully tested). file.type Type ADMS file imported. default, \"unknown\", import uses file extension identify file type , recognised, uses identify file structure import method applied. file extension recognised choice may forced setting file.type one known file.type options: \"bgd\", \"met\", \"mop\" \"pst\". drop.case Option convert data names lower case. Default, TRUE. Alternative, FALSE, returns data name cases defined file. drop.input.dates Option remove ADMS \"hour\", \"day\", \"year\" data columns generating openair \"date\" timeseries. Default, TRUE. Alternative, FALSE, returns \"date\" associated ADMS data columns part openair data frame. keep.units Option retain ADMS data units. Default, TRUE, retains units (recoverable) character vector data frame comment defined file. Alternative, FALSE, discards units. (NOTE: currently, .bgd .pst files assign units. , option ignored importing .met .mop files.) simplify.names Option simplify data names accordance common openair practices. Default, TRUE. Alternative, FALSE, returns data names interpreted standard R. (NOTE: ADMS file data names include symbols structures R allow part name, renaming automatic regardless simplify.names setting. example, brackets symbols removed names replaced \".\", names form \"1/x\" may returned \"X1.x\" \"recip.x\".) test.file.structure Option test file structure trying import. Default, TRUE, tests expected file structure halts import operation found. Alternative, FALSE, attempts import regardless structure. drop.delim Option remove delim columns data frame. ADMS .mop files include two columns, \"INPUT_DATA:\" \"PROCESSED_DATA:\", separate model input output types. Default, TRUE, removes . Alternative, FALSE, retains part import. (Note: Option ignored importing .bgd, .met .pst files.) add.prefixes Option add prefixes data names. ADMS .mop files include number input process data types shared names. Prefixes can automatically added individual data can readily identified R/openair environment. Default, TRUE, adds \"process.\" prefix processed data. options include: FALSE uses prefixes leave name rationalisation R, character vectors treated required prefixes. one vector sent, treated processed data prefix. two () vectors sent, first second treated input processed data prefixes, respectively. example, argument (add.prefixes=\"\") add \"\" prefix processed data names, argument (add.prefixes=c(\"\",\"\")) add \"\" \"\" prefixes input output data names, respectively. (Note: Option ignored importing .bgd, .met .pst files.) names Option applied simplifyNamesADMS simplify.names enabled. names simplified default setting, NULL. .MOP files, return variables . = TRUE large number processed variables returned. ... Arguments passed utils::read.csv header logical value indicating whether file contains names variables first line. missing, value determined file format: header set TRUE first row contains one fewer field number columns. sep field separator character. Values line file separated character. sep = \"\" ( default read.table) separator ‘white space’, one spaces, tabs, newlines carriage returns. quote set quoting characters. disable quoting altogether, use quote = \"\". See scan behaviour quotes embedded quotes. Quoting considered columns read character, unless colClasses specified. dec character used file decimal points. fill logical. TRUE case rows unequal length, blank fields implicitly added. See ‘Details’. comment.char character: character vector length one containing single character empty string. Use \"\" turn interpretation comments altogether.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"standard use importADMS() returns data frame use openair. comparison original file, resulting data frame modified follows: Time date information combined single column \"date\", formatted conventional timeseries (.POSIX*). drop.input.dates enabled data series combined generated new \"date\" data series also removed. simplify.names enabled common chemical names may simplified, parameters may reset openair standards (e.g. \"ws\", \"wd\" \"temp\") according operations defined simplifyNamesADMS. summary simplification operations can obtained using, e.g., call importADMS(simplify.names). drop.case enabled upper case characters names converted lower case. keep.units enabled data units information may also retained part data frame comment available. .mop files, input processed data series names may also modified basis drop.delim add.prefixes settings","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"importADMS function developed help import various ADMS file types openair. cases parent import function work default configuration, e.g. mydata <- importADMS(). function currently recognises four file formats: .bgd, .met, .mop .pst. file extensions set file structure known, import call can forced , e.g, mydata <- importADMS(file.type=\"bgd\"). options can adjusted provide fine control data structuring renaming.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Times assumed GMT. Zero wind directions reset 360 part .mop file import.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"Karl Ropkins, David Carslaw Matthew Williams (CERC).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importADMS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CERC Atmospheric Dispersion Modelling System (ADMS) data import function(s) for openair — importADMS","text":"","code":"########## #example 1 ########## #To be confirmed #all current simplify.names operations importADMS(simplify.names) #> Simplification operation summary #> [ADMS => R => OPENAIR]: #> \t1/LMO => X1.LMO => RECIP.LMO #> \t1/MONIN-OBUKHOV LENGTH => X1.MONIN.OBUKHOV.LENGTH => RECIP.LMO #> \tALBEDO(D) => ALBEDO.D. => ALBEDO.DISP #> \tALBEDO (D) => ALBEDO..D. => ALBEDO.DISP #> \tALBEDO(DISP) => ALBEDO.DISP. => ALBEDO.DISP #> \tALBEDO (DISP) => ALBEDO..DISP. => ALBEDO.DISP #> \tALBEDO (DISPERSION AREA) => ALBEDO..DISPERSION.AREA. => ALBEDO.DISP #> \tALBEDO(M) => ALBEDO.M. => ALBEDO.MET #> \tALBEDO (M) => ALBEDO..M. => ALBEDO.MET #> \tALBEDO(MET) => ALBEDO.MET. => ALBEDO.MET #> \tALBEDO (MET) => ALBEDO..MET. => ALBEDO.MET #> \tALBEDO (MET SITE) => ALBEDO..MET.SITE. => ALBEDO.MET #> \tALPHA(D) => ALPHA.D. => ALPHA.DISP #> \tALPHA (D) => ALPHA..D. => ALPHA.DISP #> \tALPHA(DISP) => ALPHA.DISP. => ALPHA.DISP #> \tALPHA (DISP) => ALPHA..DISP. => ALPHA.DISP #> \tALPHA(M) => ALPHA.M. => ALPHA.MET #> \tALPHA (M) => ALPHA..M. => ALPHA.MET #> \tALPHA(MET) => ALPHA.MET. => ALPHA.MET #> \tALPHA (MET) => ALPHA..MET. => ALPHA.MET #> \tBL DEPTH => BL.DEPTH => H #> \tBOUNDARY LAYER DEPTH => BOUNDARY.LAYER.DEPTH => H #> \tBUOYANCY FREQUENCY ABOVE BOUNDARY LAYER => BUOYANCY.FREQUENCY.ABOVE.BOUNDARY.LAYER => NU #> \tCLOUD => CLOUD => CL #> \tCLOUD AMOUNT (OKTAS) => CLOUD.AMOUNT..OKTAS. => CL #> \tConc|ppb|NAME|SOURCES|-| RESOLUTION => Conc.ppb.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tConc|ppm|NAME|SOURCES|-| RESOLUTION => Conc.ppm.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tConc|ug/m3|NAME|SOURCES|-| RESOLUTION => Conc.ug.m3.NAME.SOURCES....RESOLUTION => NAME.SOURCES.RESOLUTION #> \tNAME.All.sources.1hr => NAME.All.sources.1hr => NAME #> \tNAME.All.sources.RESOLUTION => NAME.All.sources.RESOLUTION => NAME.RESOLUTION #> \tNAME.SOURCE.1hr => NAME.SOURCE.1hr => NAME.SOURCE #> \tD(RELATIVE HUMIDITY)/DZ ABOVE BOUNDARY LAYER (PERCENT/M) => D.RELATIVE.HUMIDITY..DZ.ABOVE.BOUNDARY.LAYER..PERCENT.M. => DRHDZU #> \tDELTAPHI => DELTAPHI => DELTA.WD #> \tDELTAT => DELTAT => DELTA.T #> \tDELTA T => DELTA.T => DELTA.T #> \tDELTATHETA => DELTATHETA => DELTA.THETA #> \tDELTA THETA => DELTA.THETA => DELTA.THETA #> \tDIRN CHANGE => DIRN.CHANGE => DELTA.WD #> \tDRH/DZ => DRH.DZ => DRHDZU #> \tGEOSTROPHIC MINUS SURFACE WIND DIRECTION (DEGREES) => GEOSTROPHIC.MINUS.SURFACE.WIND.DIRECTION..DEGREES. => DELTA.WD #> \tHEAT FLUX => HEAT.FLUX => FTHETA0 #> \tINCOMING SOLAR RADIATION => INCOMING.SOLAR.RADIATION => K #> \tLATENT HEAT FLUX => LATENT.HEAT.FLUX => LAMBDAE #> \tLAT HT FLUX => LAT.HT.FLUX => LAMBDAE #> \tMODIFIED PRIESTLEY-TAYLOR PARAMETER (DISPERSION AREA) => MODIFIED.PRIESTLEY.TAYLOR.PARAMETER..DISPERSION.AREA. => ALPHA.DISP #> \tMODIFIED PRIESTLEY-TAYLOR PARAMETER (MET SITE) => MODIFIED.PRIESTLEY.TAYLOR.PARAMETER..MET.SITE. => ALPHA.MET #> \tN ABOVE BL => N.ABOVE.BL => NU #> \tPHI => PHI => WD #> \tPHI0 => PHI0 => WD.0 #> \tPHIG => PHIG => WD.G #> \tPHISEC => PHISEC => WD.SEC #> \tPRECIP => PRECIP => P #> \tPRECIPITATION RATE (MM/HOUR) => PRECIPITATION.RATE..MM.HOUR. => P #> \tR => R => ALBEDO.MET #> \tRECIPLMO => RECIPLMO => RECIP.LMO #> \tRELATIVE HUMIDITY ABOVE BOUNDARY LAYER (PERCENT) => RELATIVE.HUMIDITY.ABOVE.BOUNDARY.LAYER..PERCENT. => RHU #> \tRH ABOVE BL => RH.ABOVE.BL => RHU #> \tRHUM => RHUM => RHU #> \tROUGHNESS LENGTH (DISPERSION AREA) => ROUGHNESS.LENGTH..DISPERSION.AREA. => Z0.DISP #> \tROUGHNESS LENGTH (MET SITE) => ROUGHNESS.LENGTH..MET.SITE. => Z0.MET #> \tS HUMIDITY => S.HUMIDITY => SHU #> \tSEA SURFACE TEMPERATURE (C) => SEA.SURFACE.TEMPERATURE..C. => TSEA #> \tSEA TEMP => SEA.TEMP => TSEA #> \tSENSIBLE HEAT FLUX => SENSIBLE.HEAT.FLUX => FTHETA0 #> \tSIGMATHETA => SIGMATHETA => SIGMA.THETA #> \tSIGMA THETA => SIGMA.THETA => SIGMA.THETA #> \tSIGMA THETA (DEGREES) => SIGMA.THETA..DEGREES. => SIGMA.THETA #> \tSOLAR RAD => SOLAR.RAD => K #> \tSPECIFIC HUMIDITY => SPECIFIC.HUMIDITY => SHU #> \tT0C => T0C => TEMP #> \tTEMPERATURE => TEMPERATURE => TEMP #> \tTEMPERATURE (C) => TEMPERATURE..C. => TEMP #> \tTEMPERATURE JUMP ACROSS BOUNDARY LAYER TOP => TEMPERATURE.JUMP.ACROSS.BOUNDARY.LAYER.TOP => DELTA.THETA #> \tTEMPERATURE OVER LAND MINUS SEA SURFACE TEMPERATURE => TEMPERATURE.OVER.LAND.MINUS.SEA.SURFACE.TEMPERATURE => DELTA.T #> \tTime(s) => Time.s. => Time #> \tU => U => WS #> \tUG => UG => WS.G #> \tUGSTAR => UGSTAR => WS.GSTAR #> \tUSTAR => USTAR => WS.STAR #> \tWIND DIRN => WIND.DIRN => WD #> \tWIND DIRECTION (DEGREES) => WIND.DIRECTION..DEGREES. => WD #> \tWIND HEIGHT => WIND.HEIGHT => WIND.HEIGHT #> \tWIND MEASUREMENT HEIGHT => WIND.MEASUREMENT.HEIGHT => WIND.HEIGHT #> \tWIND SPEED => WIND.SPEED => WS #> \tX(m) => X.m. => X #> \tY(m) => Y.m. => Y #> \tZ(m) => Z.m. => Z #> \tZ0(D) => Z0.D. => Z0.DISP #> \tZ0 (D) => Z0..D. => Z0.DISP #> \tZ0(DISP) => Z0.DISP. => Z0.DISP #> \tZ0 (DISP) => Z0..DISP. => Z0.DISP #> \tZ0(M) => Z0.M. => Z0.MET #> \tZ0 (M) => Z0..M. => Z0.MET #> \tZ0(MET) => Z0.MET. => Z0.MET #> \tZ0 (MET) => Z0..MET. => Z0.MET #to see what simplify.names does to adms data series name PHI new.name <- importADMS(simplify.names, names=\"PHI\") new.name #> [1] \"WD\""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":null,"dir":"Reference","previous_headings":"","what":"Import air quality data from European database — importEurope","title":"Import air quality data from European database — importEurope","text":"function simplified version saqgetr package (see https://github.com/skgrange/saqgetr) accessing European air quality data. function returns valid hourly data meant fast convenient way accessing common type hourly air quality data. function works way openair functions import air quality data generally need site code year supplied.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import air quality data from European database — importEurope","text":"","code":"importEurope( site = \"debw118\", year = 2018, tz = \"UTC\", meta = FALSE, to_narrow = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import air quality data from European database — importEurope","text":"site code site(s). year Year years import. import sequence years 1990 2000 use year = 1990:2000. import several specific years use year = c(1990, 1995, 2000) example. tz used meta meta data returned? TRUE site type, latitude longitude returned. to_narrow default returned data column pollutant/variable. to_narrow = TRUE data stacked narrow format column identifying pollutant name. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import air quality data from European database — importEurope","text":"tibble","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import air quality data from European database — importEurope","text":"function can however return key site meta data. saqgetr package much comprehensive provides data time averages e.g. daily data.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importEurope.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import air quality data from European database — importEurope","text":"","code":"# import data for Stuttgart Am Neckartor (S) if (FALSE) { # \\dontrun{ stuttgart <- importEurope(\"debw118\", year = 2010:2019, meta = TRUE) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from King's College London networks — importKCL","title":"Import data from King's College London networks — importKCL","text":"Function importing hourly mean data King's College London networks. Files imported remote server operated King's College London provides air quality data files R data objects.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from King's College London networks — importKCL","text":"","code":"importKCL( site = \"my1\", year = 2009, pollutant = \"all\", met = FALSE, units = \"mass\", extra = FALSE, meta = FALSE, to_narrow = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from King's College London networks — importKCL","text":"site Site code network site import e.g. \"my1\" Marylebone Road. Several sites can imported site = c(\"my1\", \"kc1\") — import Marylebone Road North Kensignton example. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. met meteorological data added import data? default FALSE. TRUE wind speed (m/s), wind direction (degrees), solar radiation rain amount available. See details . units default returned data frame expresses units mass terms (ug/m3 NOx, NO2, O3, SO2; mg/m3 CO). Use units = \"volume\" use ppb etc. PM10_raw TEOM data multiplied 1.3 PM2.5 correction applied. See details concerning PM10 concentrations. extra currently used. meta Append site type, latitude longitude selected site? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import data from King's College London networks — importKCL","text":"Returns data frame hourly mean values date POSIXct class time zone GMT.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import data from King's College London networks — importKCL","text":"importKCL function written make easy import data King's College London air pollution networks. KCL provided .RData files (R workspaces) individual sites years KCL networks. files updated weekly basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. Finally, easy import many years data beyond current limit 64,000 lines. final point makes possible download several long time series one go. function also advantage proper site name imported used openair functions. site codes pollutant names can upper lower case. function issue warning data less six months old downloaded, may ratified. data imported stacking sites top one another field names date, site, code (site code) pollutant(s). Sometimes useful columns site data. can done using reshape function — see examples . situation particle measurements straightforward given variety methods used measure particle mass changes use time. importKCL function imports two measures PM10 available. PM10_raw TEOM measurements 1.3 factor applied take account volatile losses. PM10 data current best estimate gravimetric equivalent measure described . NOTE! many sites several instruments measure PM10 PM2.5. case FDMS measurements, given separate site codes (see ). example \"MY1\" TEOM VCM applied \"MY7\" FDMS data. FDMS data used volatile non-volatile components separately reported .e. v10 = volatile PM10, v2.5 = volatile PM2.5, nv10 = non-volatile PM10 nv2.5 = non-volatile PM2.5. Therefore, PM10 = v10 + nv10 PM2.5 = v2.5 + nv2.5. assessment EU Limit Values, PM10 needs measured using reference method one shown equivalent reference method. Defra carried extensive trials 2004 2006 establish types particulate analysers use UK equivalent. trials found measurements made using Partisol, FDMS, BAM SM200 instruments shown equivalent PM10 reference method. However, correction factors need applied measurements SM200 BAM instruments. Importantly, TEOM demonstrated equivalent reference method due loss volatile PM, even 1.3 correction factor applied. Volatile Correction Model (VCM) developed Defra King's allow measurements PM10 TEOM instruments converted reference equivalent; uses measurements volatile PM made using nearby FDMS instruments correct measurements made TEOM. passed equivalence testing using methodology used Defra trials now recommended method correcting TEOM measurements (Defra, 2009). VCM correction TEOM measurements can applied 1st January 2004, sufficiently widespread measurements volatile PM became available. 1.3 correction factor now considered redundant measurements PM10 made 1st January 2004. information VCM can found http://www.volatile-correction-model.info/. PM10 statistics LondonAir web site, including bulletins statistical tools (RData objects downloaded using importKCL), now report PM10 results reference equivalent. PM10 measurements made BAM SM200 analysers applicable correction factors applied. measurements TEOM analysers 1.3 factor applied 1st January 2004, VCM method used convert reference equivalent. meteorological data meant represent 'typical' conditions London, users may prefer use data. data provide estimate general meteorological conditions across Greater London. meteorological species (wd, ws, rain, solar) data point formed averaging measurements subset LAQN monitoring sites identified minimal disruption local obstacles long term reliable dataset. exact sites used varies species, include two five sites per species. Therefore, data represent 'London scale' meteorology, rather local conditions. function developed, following site codes help selection. also make available meta data site type location make easier select sites based information. Note codes need refined common species available export currently .e. NOx, NO2, O3, CO, SO2, PM10, PM2.5. A30 | Kingston - Kingston Bypass A3 | Roadside AD1 | Shoreham--Sea | Kerbside AR1 | Chichester - Lodsworth | Rural AR2 | Wealden - Isfield | Rural AS1 | Bath Aethalometer | Urban Background BA1 | Basildon - Gloucester Park | Roadside BB1 | Broxbourne (Roadside) | Roadside BE0 | Belfast - Carbon | Urban Background BE1 | Belfast Centre AURN | Urban Background BE3 | Belfast Centre Aethalometer | Urban Background BE7 | Belfast Centre FDMS trial | Urban Background BE8 | Belfast - Nitrate | Urban Background BE9 | Belfast - Partisol SO4 | Urban Background BF1 | Bedford Stewartby (Rural) | Industrial BF3 | Bedford - Kempston | Industrial BF4 | Bedford - Prebend Street | Roadside BF5 | Bedford - Lurke Street | Roadside BG1 | Barking Dagenham - Rush Green | Suburban BG2 | Barking Dagenham - Scrattons Farm | Suburban BG3 | Barking Dagenham - North Street | Kerbside BH0 | Brighton Preston Park AURN | Urban Background BH1 | Brighton Roadside | Roadside BH2 | Brighton Hove - Hove Town Hall | Roadside BH3 | Brighton Hove - Foredown Tower | Urban Background BH5 | Brighton Mobile (Preston Fire Station) | Roadside BH6 | Brighton Mobile (Lewes Road) | Roadside BH7 | Brighton Mobile (Gloucester Road) | Roadside BH8 | Brighton Hove - Stanmer Park | Rural BH9 | Brighton Mobile Beaconsfield Road | Roadside BI1 | Birmingham Tyburn CPC | Urban Background BL0 | Camden - Bloomsbury | Urban Background BL1 | Bloomsbury AURN SMPS | Urban Background BM1 | Ballymena - Ballykeel | Suburban BM2 | Ballymena - North Road | Roadside BN1 | Barnet - Tally Ho Corner | Kerbside BN2 | Barnet Finchley | Urban Background BN3 | Barnet - Strawberry Vale | Urban Background BO1 | Ballymoney 1 | Suburban BP0 | Westminster - Bridge Place | Urban Background BQ5 | Bexley - Manor Road West Gravimetric | Industrial BQ6 | Bexley - Manor Road East Gravimetric | Industrial BQ7 | Belvedere West | Urban Background BQ8 | Belvedere West FDMS | Urban Background BT1 | Brent - Kingsbury | Suburban BT2 | Brent - Ikea Car Park | Roadside BT3 | Brent - Harlesden | Roadside BT4 | Brent - Ikea | Roadside BT5 | Brent - Neasden Lane | Industrial BT6 | Brent - John Keble Primary School | Roadside BT7 | Brent - St Marys Primary School | Urban Background BW1 | Brentwood - Brentwood Town Hall | Urban Background BX0 | Bexley - Belvedere FDMS | Suburban BX1 | Bexley - Slade Green | Suburban BX2 | Bexley - Belvedere | Suburban BX3 | Bexley - Thamesmead | Suburban BX4 | Bexley - Erith | Industrial BX5 | Bexley - Bedonwell | Suburban BX6 | Bexley - Thames Road North FDMS | Roadside BX7 | Bexley - Thames Road North | Roadside BX8 | Bexley - Thames Road South | Roadside BX9 | Bexley - Slade Green FDMS | Suburban BY1 | Bromley - Rent Office | Urban Background BY4 | Bromley - Tweedy Rd | Roadside BY5 | Bromley - Biggin Hill | Suburban BY7 | Bromley - Harwood Avenue | Roadside CA1 | Crawley Background | Urban Background CA2 | Crawley - Gatwick Airport | Urban Background CB1 | Chelmsford - Fire Station | Roadside CB2 | Chelmsford - Springfield Road | Roadside CB3 | Chelmsford - Chignal St James | Urban Background CB4 | Chelmsford - Baddow Road | Roadside CC1 | Colchester - Lucy Lane South | Roadside CC2 | Colchester - Brook Street | Roadside CC3 | Colchester - Mersea Road | Roadside CD1 | Camden - Swiss Cottage | Kerbside CD3 | Camden - Shaftesbury Avenue | Roadside CD4 | Camden - St Martins College (NOX | Urban Background CD5 | Camden - St Martins College (NOX 2) | Urban Background CD7 | Camden - Swiss Cottage Partisol | Kerbside CD9 | Camden - Euston Road | Roadside CF1 | Cardiff Aethalometer | Urban Background CH1 | Cheltenham | Urban Background CI1 | Chichester - A27 Chichester Bypass | Roadside CI4 | Chichester - Orchard Street | Roadside CK1 | Cookstown | Suburban CP1 | Castle Point - Canvey Island | Urban Background CR2 | Croydon - Purley Way | Roadside CR3 | Croydon - Thornton Heath | Suburban CR4 | Croydon - George Street | Roadside CR5 | Croydon - Norbury | Kerbside CR6 | Croydon - Euston Road | Suburban CT1 | City London - Senator House | Urban Background CT2 | City London - Farringdon Street | Kerbside CT3 | City London - Sir John Cass School | Urban Background CT4 | City London - Beech Street | Roadside CT6 | City London - Walbrook Wharf | Roadside CT8 | City London - Upper Thames Street | Roadside CY1 | Crystal Palace - Crystal Palace Parade | Roadside DC1 | Dacorum 1 Hemel Hempstead (Background) | Urban Background DC2 | Dacorum 2 Hemel Hempstead (Background) | Urban Background DC3 | High Street Northchurch | Roadside DE1 | Derry City - Brandywell | Urban Background DE2 | Derry City - Dales Corner | Roadside DM1 | Dunmurry Aethalometer | Urban Background EA0 | Ealing - Acton Town Hall FDMS | Roadside EA1 | Ealing - Ealing Town Hall | Urban Background EA2 | Ealing - Acton Town Hall | Roadside EA3 | Ealing 3 - A40 East Acton | Roadside EA4 | Ealing Mobile - Hamilton Road | Roadside EA5 | Ealing Mobile - Southall | Roadside EA6 | Ealing - Hanger Lane Gyratory | Roadside EA7 | Ealing - Southall | Urban Background EA8 | Ealing - Horn Lane | Industrial EA9 | Ealing - Court Way | Roadside EB1 | Eastbourne - Devonshire Park | Urban Background EB3 | Eastbourne - Holly Place | Urban Background EH1 | E Herts Throcking (Rural) | Rural EH2 | East Herts Sawbridgeworth (Background) | Urban Background EH3 | East Herts Sawbridgeworth (Roadside) | Roadside EH4 | East Herts Ware | Roadside EH5 | East Herts Bishops Stortford | Roadside EI0 | Ealing - Greenford | Urban Background EI1 | Ealing - Western Avenue | Roadside EL1 | Elmbridge - Bell Farm Hersham | Urban Background EL2 | Elmbridge - Esher High Street | Roadside EL3 | Elmbridge - Hampton Court Parade | Roadside EL4 | Elmbridge - Walton High Street | Kerbside EN1 | Enfield - Bushhill Park | Suburban EN2 | Enfield Church Street | Roadside EN3 | Enfield - Salisbury School | Urban Background EN4 | Enfield - Derby Road | Roadside EN5 | Enfield - Bowes Primary School | Roadside FB1 | Rushmoor - Medway Drive | Roadside GB0 | Greenwich Bexley - Falconwood FDMS | Roadside GB6 | Greenwich Bexley - Falconwood | Roadside GL1 | Glasgow Centre | Suburban GL4 | Glasgow Centre Aethalometer | Suburban GN0 | Greenwich - A206 Burrage Grove | Roadside GN2 | Greenwich - Millennium Village | Industrial GN3 | Greenwich - Plumstead High Street | Roadside GN4 | Greenwich - Fiveways Sidcup Rd A20 | Roadside GR4 | Greenwich - Eltham | Suburban GR5 | Greenwich - Trafalgar Road | Roadside GR7 | Greenwich - Blackheath | Roadside GR8 | Greenwich - Woolwich Flyover | Roadside GR9 | Greenwich - Westhorne Avenue | Roadside HA0 | Harwell - Carbon | Rural HA1 | Harwell Rural AURN | Rural HA2 | Harwell Rural PARTISOL | Rural HA4 | Harwell Rural SMPS | Rural HA9 | Harwell - Partisol SO4 | Urban Background HF1 | Hammersmith Fulham - Broadway | Roadside HF2 | Hammersmith Fulham - Brook Green | Urban Background HF3 | Hammersmith Fulham - Scrubs Lane | Kerbside HG1 | Haringey - Haringey Town Hall | Roadside HG2 | Haringey - Priory Park | Urban Background HG3 | Haringey - Bounds Green | Roadside HI0 | Hillingdon - Sipson Road | Suburban HI1 | Hillingdon - South Ruislip | Roadside HI2 | Hillingdon - Hillingdon Hospital | Roadside HI3 | Hillingdon - Oxford Avenue | Roadside HK4 | Hackney - Clapton | Urban Background HK6 | Hackney - Old Street | Roadside HL1 | Halifax Aethalometer | Urban Background HM1 | Hertsmere Borehamwood 1 (Background) | Urban Background HM4 | Hertsmere - Borehamwood | Urban Background HO1 | Horsham Background | Urban Background HO2 | Horsham - Park Way | Roadside HO4 | Horsham - Storrington | Roadside HO5 | Horsham - Cowfold | Roadside HR1 | Harrow - Stanmore | Urban Background HR2 | Harrow - Pinner Road | Roadside HS1 | Hounslow - Brentford | Roadside HS2 | Hounslow - Cranford | Suburban HS3 | Hounslow - Brentford | Roadside HS4 | Hounslow - Chiswick High Road | Roadside HS5 | Hounslow - Brentford | Roadside HS6 | Hounslow - Heston Road | Roadside HS7 | Hounslow - Hatton Cross | Urban Background HS9 | Hounslow - Feltham | Roadside HT1 | Hastings - Bulverhythe | Roadside HT2 | Hastings - Fresh Fields | Roadside HV1 | Havering - Rainham | Roadside HV2 | Havering - Harold Hill | Suburban HV3 | Havering - Romford | Roadside HX0 | Birmingham Tyburn Aethalometer | Urban Background IC6 | City London Walbrook Wharf Indoor | Roadside IG4 | Greenwich - Eltham Ecology Centre Indoor | Urban Background IS1 | Islington - Upper Street | Urban Background IS2 | Islington - Holloway Road | Roadside IS4 | Islington - Foxham Gardens | Urban Background IS5 | Islington - Duncan Terrace | Roadside IS6 | Islington - Arsenal | Urban Background IT2 | Tower Hamlets - Mile End Road | Roadside KB1 | South Kirkby Aethalometer | Urban Background KC0 | North Kensington - Carbon | Urban Background KC1 | Kensington Chelsea - North Ken | Urban Background KC2 | Kensington Chelsea - Cromwell Road | Roadside KC3 | Kensington Chelsea - Knightsbridge | Roadside KC4 | Kensington Chelsea - Kings Road | Roadside KC5 | Kensington Chelsea - Earls Court Rd | Kerbside KC7 | Kensington Chelsea - North Ken FDMS | Urban Background KC9 | North Kensington - Partisol SO4 | Urban Background KT1 | Kingston - Chessington | Suburban KT2 | Kingston - Town Centre | Roadside LA1 | Luton Airport | Urban Background LB1 | Lambeth - Christchurch Road | Roadside LB2 | Lambeth - Vauxhall Cross | Roadside LB3 | Lambeth - Loughborough Junct | Urban Background LB4 | Lambeth - Brixton Road | Kerbside LB5 | Lambeth - Bondway Interchange | Roadside LB6 | Lambeth - Streatham Green | Urban Background LH0 | Hillingdon - Harlington | Urban Background LH2 | Heathrow Airport | Urban Background LL1 | Lullington Heath Rural AURN | Rural LN1 | Luton - Challney Community College | Urban Background LS1 | Lewes - Telscombe Cliffs | Roadside LS2 | Lewes - Commercial Square | Roadside LS4 | Newhaven - Denton School | Urban Background LW1 | Lewisham - Catford | Urban Background LW2 | Lewisham - New Cross | Roadside LW3 | Lewisham Mercury Way | Industrial MA1 | Manchester Piccadilly CPC | Urban Background MA2 | Manchester Piccadilly | Urban Background MD1 | Mid Beds Biggleswade (Roadside) | Roadside MD2 | Mid Beds Silsoe (Rural) | Rural MD3 | Central Beds - Sandy | Roadside MD4 | Central Beds - Marston Vale | Rural ME1 | Merton - Morden Civic Centre | Roadside MP1 | Marchwood Power - Marchwood | Industrial MP2 | Marchwood Power - Millbrook Rd Soton | Industrial MR3 | Marylebone Road Aethalometer | Kerbside MV1 | Mole Valley - Leatherhead | Rural MV2 | Mole Valley - Lower Ashtead | Suburban MV3 | Mole Valley - Dorking | Urban Background MW1 | Windsor Maidenhead - Frascati Way | Roadside MW2 | Windsor Maidenhead - Clarence Road | Roadside MW3 | Windsor Maidenhead - Ascot | Rural MY0 | Marylebone Road - Carbon | Kerbside MY1 | Westminster - Marylebone Road | Kerbside MY7 | Westminster - Marylebone Road FDMS | Kerbside NA5 | Newtownabbey- Mallusk | Urban Background NA6 | Newtownabbey- Shore Road | Roadside NE2 | Port Talbot TEOM CPC | Urban Background NF1 | New Forest - Holbury | Industrial NF2 | New Forest - Fawley | Industrial NF3 | New Forest - Ringwood | Urban Background NF4 | New Forest - Totton | Roadside NF5 | New Forest - Lyndhurst | Roadside NH1 | North Herts Mobile - Baldock 1 | Roadside NH2 | North Herts Mobile - Baldock 2 | Roadside NH3 | North Herts Mobile - Royston | Urban Background NH4 | North Herts - Breechwood Green | Urban Background NH5 | North Herts - Baldock Roadside | Roadside NH6 | North Herts - Hitchin Library | Roadside NK1 | North Kensington - CPC | Urban Background NK3 | North Kensington Aethalometer | Urban Background NK6 | North Kensington - URG | Urban Background NM1 | Newham - Tant Avenue | Urban Background NM2 | Newham - Cam Road | Roadside NM3 | Newham - Wren Close | Urban Background NW1 | Norwich Centre Aethalometer | Urban Background OX0 | Oxford Centre Roadside AURN | Urban Background OX1 | South Oxfordshire - Henley | Roadside OX2 | South Oxfordshire - Wallingford | Roadside OX3 | South Oxfordshire - Watlington | Roadside OX4 | Oxford St Ebbes AURN | Urban Background PO1 | Portsmouth Background AURN | Urban Background PT6 | Port Talbot Dyffryn School | Industrial RB1 | Redbridge - Perth Terrace | Urban Background RB2 | Redbridge - Ilford Broadway | Kerbside RB3 | Redbridge - Fullwell Cross | Kerbside RB4 | Redbridge - Gardner Close | Roadside RB5 | Redbridge - South Woodford | Roadside RD0 | Reading AURN - New Town | Urban Background RD1 | Reading - Caversham Road | Roadside RD2 | Reading - Kings Road | Roadside RD3 | Reading - Oxford Road | Roadside RG1 | Reigate Banstead - Horley | Suburban RG2 | Reigate Banstead - Horley South | Suburban RG3 | Reigate Banstead - Poles Lane | Rural RG4 | Reigate Banstead - Reigate High St | Kerbside RHA | Richmond - Lower Mortlake Road | Roadside RHB | Richmond - Lower Mortlake Road | Roadside RI1 | Richmond - Castelnau | Roadside RI2 | Richmond - Barnes Wetlands | Suburban RI5 | Richmond Mobile - St Margarets | Kerbside RI6 | Richmond Mobile St Margarets | Kerbside RI7 | Richmond Mobile - Richmond Park | Suburban RI8 | Richmond Mobile - Richmond Park | Suburban RIA | Richmond Mobile - George Street | Kerbside RIB | Richmond Mobile - George Street | Kerbside RIC | Richmond Mobile - Kew Rd | Kerbside RID | Richmond Mobile - Kew Rd | Kerbside RIE | Richmond Mobile Richmond Rd Twickenham | Roadside RIF | Richmond Mobile - Richmond Rd Twickenham | Roadside RIG | Richmond Mobile - Upper Teddington Rd | Roadside RIH | Richmond Mobile - Upper Teddington Rd | Roadside RII | Richmond Mobile - Somerset Rd Teddington | Urban Background RIJ | Richmond Mobile - Somerset Rd Teddington | Urban Background RIK | Richmond Mobile - St. Margarets Grove | Urban Background RIL | Richmond Mobile - St. Margarets Grove | Urban Background RIM | Richmond Mobile - Petersham Rd Ham | Roadside RIN | Richmond Mobile - Petersham Rd Ham | Roadside RIO | Richmond Mobile - Stanley Rd Twickenham | Roadside RIP | Richmond Mobile - Stanley Rd Twickenham | Roadside RIQ | Richmond Mobile - Richmond Rd Twickenham | Roadside RIR | Richmond Mobile - Richmond Rd Twickenham | Roadside RIS | Richmond Mobile - Lincoln Ave Twickenham | Roadside RIU | Richmond Mobile - Mortlake Rd Kew | Roadside RIW | Richmond - Upper Teddington Road | Roadside RIY | Richmond - Hampton Court Road | Kerbside RO1 | Rochford - Rayleigh High Street | Roadside RY1 | Rother - Rye Harbour | Rural RY2 | Rother - De La Warr Road | Roadside SA1 | St Albans - Fleetville | Urban Background SB1 | South Beds - Dunstable | Urban Background SC1 | Sevenoaks 1 | Suburban SD1 | Southend--Sea AURN | Urban Background SE1 | Stevenage - Lytton Way | Roadside SH1 | Southampton Background AURN | Urban Background SH2 | Southampton - Redbridge | Roadside SH3 | Southampton - Onslow Road | Roadside SH4 | Southampton - Bitterne | Urban Background SK1 | Southwark - Larcom Street | Urban Background SK2 | Southwark - Old Kent Road | Roadside SK5 | Southwark - A2 Old Kent Road | Roadside SL1 | Sunderland Aethalometer | Urban Background ST1 | Sutton - Robin Hood School | Roadside ST2 | Sutton - North Cheam | Urban Background ST3 | Sutton - Carshalton | Suburban ST4 | Sutton - Wallington | Kerbside ST5 | Sutton - Beddington Lane | Industrial ST6 | Sutton - Worcester Park | Kerbside ST7 | Sutton - Therapia Lane | Industrial SU1 | Sussex Mobile10 Stockbridge | Kerbside SU2 | Sussex Mobile11 Jct Whitley Rd | Kerbside SU3 | Sussex Mobile12 Cowfold | Kerbside SU4 | Sussex Mobile 13 Newhaven | Roadside SU5 | Sussex Mobile 14 Crawley | Roadside SU6 | Sussex Mobile15 Chichester County Hall | Urban Background SU7 | Sussex Mobile 16 Warnham | Rural SU8 | Sussex Mobile 17 Newhaven Paradise Park | Roadside SX1 | Sussex Mobile 1 | Urban Background SX2 | Sussex Mobile 2 North Berstead | Roadside SX3 | Sussex Mobile 3 | Roadside SX4 | Sussex Mobile 4 Adur | Roadside SX5 | Sussex Mobile 5 Fresh Fields Rd Hastings | Roadside SX6 | Sussex Mobile 6 Orchard St Chichester | Roadside SX7 | Sussex Mobile 7 New Road Newhaven | Roadside SX8 | Sussex Mobile 8 Arundel | Kerbside SX9 | Sussex Mobile 9 Newhaven Kerbside | Kerbside TD0 | Richmond - National Physical Laboratory | Suburban TE0 | Tendring St Osyth AURN | Rural TE1 | Tendring - Town Hall | Roadside TH1 | Tower Hamlets - Poplar | Urban Background TH2 | Tower Hamlets - Mile End Road | Roadside TH3 | Tower Hamlets - Bethnal Green | Urban Background TH4 | Tower Hamlets - Blackwall | Roadside TK1 | Thurrock - London Road (Grays) | Urban Background TK2 | Thurrock - Purfleet | Roadside TK3 | Thurrock - Stanford-le-Hope | Roadside TK8 | Thurrock - London Road (Purfleet) | Roadside TR1 | Three Rivers - Rickmansworth | Urban Background UT1 | Uttlesford - Saffron Walden Fire Station | Roadside UT2 | Uttlesford - Takeley | Urban Background UT3 | Uttlesford - Broxted Farm | Rural VS1 | Westminster - Victoria Street | Kerbside WA1 | Wandsworth - Garratt Lane | Roadside WA2 | Wandsworth - Town Hall | Urban Background WA3 | Wandsworth - Roehampton | Rural WA4 | Wandsworth - High Street | Roadside WA6 | Wandsworth - Tooting | Roadside WA7 | Wandsworth - Putney High Street | Kerbside WA8 | Wandsworth - Putney High Street Facade | Roadside WA9 | Wandsworth - Putney | Urban Background WE0 | Kensington Chelsea - Pembroke Road | Urban Background WF1 | Watford (Roadside) | Roadside WF2 | Watford - Watford Town Hall | Roadside WH1 | Welwyn Hatfield - Council Offices | Urban Background WL1 | Waltham Forest - Dawlish Road | Urban Background WL2 | Waltham Forest - Mobile | Roadside WL3 | Waltham Forest - Chingford | Roadside WL4 | Waltham Forest - Crooked Billet | Kerbside WL5 | Waltham Forest - Leyton | Roadside WM0 | Westminster - Horseferry Road | Urban Background WM3 | Westminster - Hyde Park Partisol | Roadside WM4 | Westminster - Charing Cross Library | Roadside WM5 | Westminster - Covent Garden | Urban Background WM6 | Westminster - Oxford St | Kerbside WR1 | Bradford Town Hall Aethalometer | Urban Background WT1 | Worthing - Grove Lodge | Kerbside XB1 | Bletchley | Rural XS1 | Shukri Outdoor | Industrial XS2 | Shukri Indoor | Industrial XS3 | Osiris mobile | Urban Background YH1 | Harrogate Roadside | Roadside ZA1 | Ashford Rural - Pluckley | Rural ZA2 | Ashford Roadside | Roadside ZA3 | Ashford Background | Urban Background ZA4 | Ashford M20 Background | Urban Background ZC1 | Chatham Roadside - A2 | Roadside ZD1 | Dover Roadside - Town Hall | Roadside ZD2 | Dover Roadside - Townwall Street | Roadside ZD3 | Dover Background - Langdon Cliff | Urban Background ZD4 | Dover Background - East Cliff | Urban Background ZD5 | Dover Coast Guard Met | Urban Background ZD6 | Dover Docks | Industrial ZF1 | Folkestone Suburban - Cheriton | Suburban ZG1 | Gravesham Backgrnd - Northfleet | Urban Background ZG2 | Gravesham Roadside - A2 | Roadside ZG3 | Gravesham Ind Bgd - Northfleet | Urban Background ZH1 | Thanet Rural - Minster | Rural ZH2 | Thanet Background - Margate | Urban Background ZH3 | Thanet Airport - Manston | Urban Background ZH4 | Thanet Roadside - Ramsgate | Roadside ZL1 | Luton Background | Urban Background ZM1 | Maidstone Meteorological | Urban Background ZM2 | Maidstone Roadside - Fairmeadow | Kerbside ZM3 | Maidstone Rural - Detling | Rural ZR1 | Dartford Roadside - St Clements | Kerbside ZR2 | Dartford Roadside 2 - Town Centre | Roadside ZR3 | Dartford Roadside 3 - Bean Interchange | Roadside ZS1 | Stoke Rural AURN | Rural ZT1 | Tonbridge Roadside - Town Centre | Roadside ZT2 | Tunbridge Wells Background - Town Hall | Urban Background ZT3 | Tunbridge Wells Rural - Southborough | Rural ZT4 | Tunbridge Wells Roadside - St Johns | Roadside ZT5 | Tonbridge Roadside 2 - High St | Roadside ZV1 | Sevenoaks - Greatness Park | Urban Background ZV2 | Sevenoaks - Bat Ball | Roadside ZW1 | Swale Roadside - Ospringe A2 | Roadside ZW2 | Swale Background - Sheerness | Urban Background ZW3 | Swale Roadside 2 - Ospringe Street | Roadside ZY1 | Canterbury Backgrnd - Chaucer TS | Urban Background ZY2 | Canterbury Roadside - St Dunstans | Roadside ZY4 | Canterbury St Peters Place | Roadside","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import data from King's College London networks — importKCL","text":"David Carslaw Ben Barratt","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importKCL.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import data from King's College London networks — importKCL","text":"","code":"## import all pollutants from Marylebone Rd from 1990:2009 if (FALSE) mary <- importKCL(site = \"my1\", year = 2000:2009) # \\dontrun{} ## import nox, no2, o3 from Marylebone Road and North Kensignton for 2000 if (FALSE) thedata <- importKCL(site = c(\"my1\", \"kc1\"), year = 2000, pollutant = c(\"nox\", \"no2\", \"o3\")) # \\dontrun{} ## import met data too... if (FALSE) my1 <- importKCL(site = \"my1\", year = 2008, met = TRUE) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":null,"dir":"Reference","previous_headings":"","what":"Import monitoring site meta data for UK and European networks — importMeta","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"Function import meta data air quality monitoring sites. default, function return site latitude, longitude site type, well code used functions like importUKAQ(), importKCL() importEurope(). Additional information may optionally returned.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"","code":"importMeta(source = \"aurn\", all = FALSE, year = NA, duplicate = FALSE)"},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"source One air quality networks data available openair. Available networks include: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. \"kcl\", King's College London networks. \"europe\", European AirBase/e-reporting data. two additional options provided convenience: \"ukaq\" return metadata networks data imported importUKAQ() (.e., AURN, AQE, SAQN, WAQN, NI, local networks). \"\" import available metadata (.e., \"ukaq\" plus \"kcl\" \"europe\"). = FALSE site code, site name, latitude longitude site type imported. Setting = TRUE import available meta data provide details (available) individual pollutants measured site. year single year selected, sites open point year returned. = TRUE sites measured particular pollutant year returned. Year can also sequence e.g. year = 2010:2020 length 2 e.g. year = c(2010, 2020), return sites open duration. Note year ignored source either \"kcl\" \"europe\". duplicate UK air quality sites part multiple networks, appear source vector two . default argument, FALSE, drops duplicate sites. TRUE return .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"data frame meta data.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"function imports site meta data several networks UK Europe: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. \"kcl\", King's College London networks. \"europe\", Hourly European data (Air Quality e-Reporting) based simplified version {saqgetr} package. default, function return site latitude, longitude site type. option = TRUE used, much detailed information returned. networks, detailed information includes per-pollutant summaries, opening closing dates sites etc. Thanks go Trevor Davies (Ricardo), Dr Stuart Grange (EMPA) Dr Ben Barratt (KCL) making data available.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importMeta.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import monitoring site meta data for UK and European networks — importMeta","text":"","code":"if (FALSE) { # \\dontrun{ # basic info: meta <- importMeta(source = \"aurn\") # more detailed information: meta <- importMeta(source = \"aurn\", all = TRUE) # from the Scottish Air Quality Network: meta <- importMeta(source = \"saqn\", all = TRUE) # from multiple networks: meta <- importMeta(source = c(\"aurn\", \"aqe\", \"local\")) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":null,"dir":"Reference","previous_headings":"","what":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"Function import pre-calculated back trajectories using NOAA HYSPLIT model. trajectories calculated select range locations expand time. cover last 20 years can used together openair functions.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"","code":"importTraj(site = \"london\", year = 2009, local = NA, progress = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"site Site code network site import e.g. \"london\". one site can imported time. following sites typically available 2000-2012, although UK ozone sites go back 1988 (code, location, lat, lon, year): year Year years import. import sequence years 1990 2000 use year = 1990:2000. import several specific years use year = c(1990, 1995, 2000) example. local File path .RData trajectory files run user stored Ricardo web server. files generated Hysplit trajectory code shown appendix openair manual. example local = 'c:/users/david/TrajFiles/'. progress Show progress bar many receptors/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"Returns data frame pre-calculated back trajectories.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"function imports pre-calculated back trajectories using HYSPLIT trajectory model (Hybrid Single Particle Lagrangian Integrated Trajectory Model. Back trajectories provide useful information air quality data analysis. However, commonly calculated researchers generally difficult calculated routine basis used easily. addition, availability back trajectories several years can useful, difficult calculate. Trajectories run 3-hour intervals stored yearly files (see ). trajectories started ground-level (10m) propagated backwards time. trajectories calculated using Global NOAA-NCEP/NCAR reanalysis data archives. global data latitude-longitude grid (2.5 degree). Note many different meteorological data sets can used run HYSPLIT e.g. including ECMWF data. However, order make practicable run store trajectories many years sites, NOAA-NCEP/NCAR reanalysis data useful. addition, archives available use widely, case many data sets e.g. ECMWF. HYSPLIT calculated trajectories based archive data may distributed without permission. wanting, example, consider higher resolution meteorological data sets may better run trajectories separately. extremely grateful NOAA making HYSPLIT available produce back trajectories open way. ask cite HYSPLIT used published work. Users can supply trajectory files plot openair. files must following fields: date, lat, lon hour.inc (see details ). files consist following information: date arrival point time repeated number times equal length back trajectory — typically 96 hours (except early file). format POSIXct. field used link air quality data. See example . receptor Receptor number, currently 1. year year month Month 1-12 day Day month 1-31 hour Hour day 0-23 GMT hour.inc Number hours back time e.g. 0 -96. lat Latitude decimal format. lon Longitude decimal format. height Height trajectory (m). pressure Pressure trajectory (kPa).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"trajectories run using February 2011 HYSPLIT model. function primarily written investigate single site time single year. trajectory files quite large care exercised importing several years /sites.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importTraj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import pre-calculated HYSPLIT 96-hour back trajectories — importTraj","text":"","code":"## import trajectory data for London in 2009 if (FALSE) mytraj <- importTraj(site = \"london\", year = 2009) # \\dontrun{} ## combine with measurements if (FALSE) theData <- importAURN(site = \"kc1\", year = 2009) mytraj <- merge(mytraj, theData, by = \"date\") # \\dontrun{} #> Error: object 'mytraj' not found"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from individual UK Air Pollution Networks — importAURN","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"functions act wrappers importUKAQ() import air pollution data range UK networks including Automatic Urban Rural Network (AURN), individual England (AQE), Scotland (SAQN), Wales (WAQN) Northern Ireland (NI) Networks, many \"locally managed\" monitoring networks across England. importUKAQ() allows data imported flexibly, including across multiple monitoring networks, functions provided convenience back-compatibility.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"","code":"importAURN( site = \"my1\", year = 2009, data_type = \"hourly\", pollutant = \"all\", hc = FALSE, meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importAQE( site = \"yk13\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importSAQN( site = \"gla4\", year = 2009, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importWAQN( site = \"card\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importNI( site = \"bel0\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE ) importLocal( site = \"ad1\", year = 2018, data_type = \"hourly\", pollutant = \"all\", meta = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"site Site code site import, e.g., \"my1\" Marylebone Road. Site codes can discovered use importMeta(). Several sites can imported . example, site = c(\"my1\", \"nott\") imports Marylebone Road Nottingham. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). data_type type data returned, defaulting \"hourly\" data. Alternative data types include: \"daily\": Daily average data. \"monthly\": Monthly average data data capture information whole network. \"annual\": Annual average data data capture information whole network. \"15_min\": 15-minute average SO2 concentrations. \"8_hour\": 8-hour rolling mean concentrations O3 CO. \"24_hour\": 24-hour rolling mean concentrations particulates. \"daily_max_8\": Maximum daily rolling 8-hour maximum O3 CO. \"daqi\": Daily Air Quality Index (DAQI). See details index defined. Note data_type available locally managed monitoring networks. pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. hc Include hydrocarbon measurements imported data? Defaults FALSE users interested using hydrocarbon data. meta Append site type, latitude longitude selected site? Defaults FALSE. meteo Append modelled meteorological data, available? Defaults TRUE, return wind speed (ws), wind direction (wd) ambient temperature (air_temp). variables calculated using WRF model run Ricardo Energy & Environment available networks. Setting meteo = FALSE useful meteorological data use preference, example worldmet package. ratified Append qc column(s) hourly data indicating whether species ratified (.e., quality-checked)? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. verbose Print messages console hourly data imported? Default FALSE. TRUE useful debugging specific year(s), site(s) source(s) imported returned. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ-wrapper.html","id":"importing-uk-air-pollution-data","dir":"Reference","previous_headings":"","what":"Importing UK Air Pollution Data","title":"Import data from individual UK Air Pollution Networks — importAURN","text":"family functions written make easy import data across several UK air quality networks. Ricardo provided .RData files (R workspaces) individual sites years, well date meta data. files updated daily basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. function also advantage proper site name imported used openair functions. Users take care using data openair web portals (example, UK AIR). One key difference data provided openair date beginning, whereas web portal provides date ending. Hourly concentrations may therefore appear offset hour, example. data imported stacking sites top one another field names site, code (site code) pollutant. default, function returns hourly average data. However, annual, monthly, daily 15 minute data (SO2) can returned using option data_type. Annual monthly data provide whole network information including data capture statistics. units expressed mass terms gaseous species (ug/m3 , NO2, NOx (NO2), SO2 hydrocarbons; mg/m3 CO). PM10 concentrations provided gravimetric units ug/m3 scaled comparable units. years variety instruments used measure particulate matter technical issues measuring PM10 complex. recent years measurements rely FDMS (Filter Dynamics Measurement System), able measure volatile component PM. cases FDMS system use separate volatile component recorded 'v10' non-volatile component 'nv10', already included absolute PM10 measurement. Prior use FDMS measurements used TEOM (Tapered Element Oscillating. Microbalance) concentrations multiplied 1.3 provide estimate total mass including volatile fraction. sites report hourly daily PM10 / PM2.5. data_type = \"daily\" hourly 'proper' daily measurements available, returned e.g. \"pm2.5\" \"gr_pm2.5\"; former corresponding data based original hourly measurements latter corresponding daily gravimetric measurements. function returns modelled hourly values wind speed (ws), wind direction (wd) ambient temperature (air_temp) available (generally around 2010). values modelled using WRF model operated Ricardo. BAM (Beta-Attenuation Monitor) instruments incorporated network throughout history scaled 1.3 heated inlet (account loss volatile particles) 0.83 heated inlet. TEOM instruments network 2008 scaled using VCM (Volatile Correction Model) values account loss volatile particles. object scaling processes provide reasonable degree comparison data sets reference method produce consistent data record operational period network, however may discontinuity time series associated instrument changes. corrections made PM2.5 data. volatile component FDMS PM2.5 (available) shown 'v2.5' column.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":null,"dir":"Reference","previous_headings":"","what":"Import data from the UK Air Pollution Networks — importUKAQ","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"Functions importing air pollution data range UK networks including Automatic Urban Rural Network (AURN), individual England (AQE), Scotland (SAQN), Wales (WAQN) Northern Ireland (NI) Networks, many \"locally managed\" monitoring networks across England. Files imported remote server operated Ricardo provides air quality data files R data objects. date list available sites can imported, see importMeta().","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"","code":"importUKAQ( site = \"my1\", year = 2022, source = NULL, data_type = \"hourly\", pollutant = \"all\", hc = FALSE, meta = FALSE, meteo = TRUE, ratified = FALSE, to_narrow = FALSE, verbose = FALSE, progress = TRUE )"},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"site Site code site import, e.g., \"my1\" Marylebone Road. Site codes can discovered use importMeta(). Several sites can imported . example, site = c(\"my1\", \"nott\") imports Marylebone Road Nottingham. Sites different networks can imported also providing multiple sources. Site codes can upper lower case. year Year(s) import. import series years use, e.g., 2000:2020. import several specific years use year = c(2000, 2010, 2020). source network site(s) belong. default, NULL, allows importUKAQ() guess correct source, preferring national networks locally managed networks. Alternatively, users can define source. Providing single network attempt import given sites provided network. Alternatively, vector sources can provided length site indicate network site individually belongs. Available networks include: \"aurn\", UK Automatic Urban Rural Network. \"aqe\", Air Quality England Network. \"saqn\", Scottish Air Quality Network. \"waqn\", Welsh Air Quality Network. \"ni\", Northern Ireland Air Quality Network. \"local\", Locally managed air quality networks England. data_type type data returned, defaulting \"hourly\" data. Alternative data types include: \"daily\": Daily average data. \"monthly\": Monthly average data data capture information whole network. \"annual\": Annual average data data capture information whole network. \"15_min\": 15-minute average SO2 concentrations. \"8_hour\": 8-hour rolling mean concentrations O3 CO. \"24_hour\": 24-hour rolling mean concentrations particulates. \"daily_max_8\": Maximum daily rolling 8-hour maximum O3 CO. \"daqi\": Daily Air Quality Index (DAQI). See details index defined. Note data_type available locally managed monitoring networks. pollutant Pollutants import. omitted import pollutants site. import NOx NO2 example use pollutant = c(\"nox\", \"no2\"). Pollutant names can upper lower case. hc Include hydrocarbon measurements imported data? Defaults FALSE users interested using hydrocarbon data. meta Append site type, latitude longitude selected site? Defaults FALSE. meteo Append modelled meteorological data, available? Defaults TRUE, return wind speed (ws), wind direction (wd) ambient temperature (air_temp). variables calculated using WRF model run Ricardo Energy & Environment available networks. Setting meteo = FALSE useful meteorological data use preference, example worldmet package. ratified Append qc column(s) hourly data indicating whether species ratified (.e., quality-checked)? Defaults FALSE. to_narrow Return data \"narrow\"/\"long\"/\"tidy\" format? default returned data \"wide\" column pollutant/variable. to_narrow = TRUE data returned column identifying pollutant name column containing corresponding concentration/statistic. Defaults FALSE. verbose Print messages console hourly data imported? Default FALSE. TRUE useful debugging specific year(s), site(s) source(s) imported returned. progress Show progress bar many sites/years imported? Defaults TRUE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"tibble","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"importing-uk-air-pollution-data","dir":"Reference","previous_headings":"","what":"Importing UK Air Pollution Data","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"family functions written make easy import data across several UK air quality networks. Ricardo provided .RData files (R workspaces) individual sites years, well date meta data. files updated daily basis. approach requires link Internet work. several advantages web portal approach .csv files downloaded. First, quick select range sites, pollutants periods (see examples ). Second, storing data .RData objects efficient four times smaller .csv files — means data downloads quickly saves bandwidth. Third, function completely avoids need data manipulation setting time formats, time zones etc. function also advantage proper site name imported used openair functions. Users take care using data openair web portals (example, UK AIR). One key difference data provided openair date beginning, whereas web portal provides date ending. Hourly concentrations may therefore appear offset hour, example. data imported stacking sites top one another field names site, code (site code) pollutant. default, function returns hourly average data. However, annual, monthly, daily 15 minute data (SO2) can returned using option data_type. Annual monthly data provide whole network information including data capture statistics. units expressed mass terms gaseous species (ug/m3 , NO2, NOx (NO2), SO2 hydrocarbons; mg/m3 CO). PM10 concentrations provided gravimetric units ug/m3 scaled comparable units. years variety instruments used measure particulate matter technical issues measuring PM10 complex. recent years measurements rely FDMS (Filter Dynamics Measurement System), able measure volatile component PM. cases FDMS system use separate volatile component recorded 'v10' non-volatile component 'nv10', already included absolute PM10 measurement. Prior use FDMS measurements used TEOM (Tapered Element Oscillating. Microbalance) concentrations multiplied 1.3 provide estimate total mass including volatile fraction. sites report hourly daily PM10 / PM2.5. data_type = \"daily\" hourly 'proper' daily measurements available, returned e.g. \"pm2.5\" \"gr_pm2.5\"; former corresponding data based original hourly measurements latter corresponding daily gravimetric measurements. function returns modelled hourly values wind speed (ws), wind direction (wd) ambient temperature (air_temp) available (generally around 2010). values modelled using WRF model operated Ricardo. BAM (Beta-Attenuation Monitor) instruments incorporated network throughout history scaled 1.3 heated inlet (account loss volatile particles) 0.83 heated inlet. TEOM instruments network 2008 scaled using VCM (Volatile Correction Model) values account loss volatile particles. object scaling processes provide reasonable degree comparison data sets reference method produce consistent data record operational period network, however may discontinuity time series associated instrument changes. corrections made PM2.5 data. volatile component FDMS PM2.5 (available) shown 'v2.5' column.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"David Carslaw, Trevor Davies, Jack Davison","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/importUKAQ.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import data from the UK Air Pollution Networks — importUKAQ","text":"","code":"if (FALSE) { # \\dontrun{ # import a single site from the AURN importUKAQ(\"my1\", year = 2022) # import sites from another network importUKAQ(c(\"bn1\", \"bn2\"), year = 2022, source = \"aqe\") # import sites across multiple networks importUKAQ(c(\"my1\", \"bn1\", \"bn2\"), year = 2022, source = c(\"aurn\", \"aqe\", \"aqe\") ) # get \"long\" format hourly data with a ratification flag importUKAQ( \"card\", source = \"waqn\", year = 2022, to_narrow = TRUE, ratified = TRUE ) # import other data types, filtering by pollutant importUKAQ( data_type = \"annual\", pollutant = c(\"no2\", \"pm2.5\", \"pm10\"), source = c(\"aurn\", \"aqe\") ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear relations between pollutants — linearRelation","title":"Linear relations between pollutants — linearRelation","text":"function considers linear relationships two pollutants. relationships calculated different times bases using linear model. slope 95% confidence interval slope relationships time unit plotted many ways. function particularly useful considering whether relationships consistent emissions inventories.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear relations between pollutants — linearRelation","text":"","code":"linearRelation( mydata, x = \"nox\", y = \"no2\", period = \"month\", condition = FALSE, n = 20, rsq.thresh = 0, ylab = paste0(\"slope from \", y, \" = m.\", x, \" + c\"), auto.text = TRUE, cols = \"grey30\", date.breaks = 5, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear relations between pollutants — linearRelation","text":"mydata data frame minimally containing date two pollutants. x First pollutant plotted appear x-axis relationship e.g. x = \"nox\". y Second pollutant plotted appear y-axis relationship e.g. y = \"pm10\". period range different time periods can analysed. default month can year week. increased flexibility integer can used e.g. 3-month values period = \"3 month\". cases include \"hour\" show diurnal relationship x y “weekday” day week relationship x y. “day.hour” plot relationship weekday hour day. condition period = \"hour\", period = \"day\" period = \"day.hour\", setting condition = TRUE plot relationships split year. useful seeing relationships may changing time. n minimum number points sent linear model. may points e.g. hours two pollutants available one week, n can set ensure least n points sent linear model. period hours < n period ignored. rsq.thresh minimum correlation coefficient (R2) allowed. relationship x y good particular period, setting rsq.thresh can help remove periods relationship strong. R2 values rsq.thresh plotted. ylab y-axis title, specified user. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. cols Colour points uncertainty intervals. date.breaks Number major x-axis intervals use. function try choose sensible number dates/times well formatting date/time appropriately range considered. always work desired automatically. user can therefore increase decrease number intervals adjusting value date.breaks . plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters. useful one remove strip date range top plot set strip = FALSE.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear relations between pollutants — linearRelation","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear relations between pollutants — linearRelation","text":"relationships pollutants can yield useful information source emissions change. scatterPlot two pollutants usual way investigate relationship. linear regression useful test strength relationship. However, considerably information can gleaned considering different time periods, relationship two pollutants vary time, day week, diurnally . linearRelation function just - fits linear relationship two pollutants wide range time periods determined period. linearRelation function particularly useful background concentrations first removed roadside concentrations, increment relate directly changes emissions. respect, using linearRelation can provide valuable information emissions may changed time, hour day etc. Using function way require users basic manipulation data first. data frame supplied contains nox, no2 o3, y can chosen y = \"ox\". function therefore consider total oxidant slope (sum NO2 + O3), can provide valuable information likely vehicle primary emissions. Note, however, roadside sites ozone measurements calcFno2 alternative.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Linear relations between pollutants — linearRelation","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/linearRelation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear relations between pollutants — linearRelation","text":"","code":"# monthly relationship between NOx and SO2 - note rapid fall in # ratio at the beginning of the series linearRelation(mydata, x = \"nox\", y = \"so2\") # monthly relationship between NOx and SO2 - note rapid fall in # ratio at the beginning of the series if (FALSE) linearRelation(mydata, x = \"nox\", y = \"ox\") # \\dontrun{} # diurnal oxidant slope by year # clear change in magnitude # starting 2003, but the diurnal profile has also changed: the # morning and evening peak hours are more important, presumably # due to change in certain vehicle types if (FALSE) linearRelation(mydata, x = \"nox\", y = \"ox\", period = \"hour\", condition = TRUE) # \\dontrun{} # PM2.5/PM10 ratio, but only plot where monthly R2 >= 0.8 if (FALSE) linearRelation(mydata, x = \"pm10\", y = \"pm25\", rsq.thresh = 0.8) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate common model evaluation statistics — modStats","title":"Calculate common model evaluation statistics — modStats","text":"Function calculate common numerical model evaluation statistics flexible conditioning.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate common model evaluation statistics — modStats","text":"","code":"modStats( mydata, mod = \"mod\", obs = \"obs\", statistic = c(\"n\", \"FAC2\", \"MB\", \"MGE\", \"NMB\", \"NMGE\", \"RMSE\", \"r\", \"COE\", \"IOA\"), type = \"default\", rank.name = NULL, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate common model evaluation statistics — modStats","text":"mydata data frame. mod Name variable mydata represents modelled values. obs Name variable mydata represents measured values. statistic statistic calculated. See details description . type type determines data split .e. conditioned, plotted. default produce statistics using entire data. type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four sets statistics — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. one type can considered e.g. type = c(\"season\", \"weekday\") produce statistics split season day week. rank.name Simple model ranking can carried rank.name supplied. rank.name generally refer column representing model name, ranked. ranking based COE performance, indicator arguably best single model performance indicator available. ... Arguments passed cutData x data frame containing field date. hemisphere Can \"northern\" \"southern\", used split data seasons. n.levels Number quantiles split numeric data . start.day day week type = \"weekday\" start ? user can change start day supplying integer 0 6. Sunday = 0, Monday = 1, ... example start weekday plots Saturday, choose start.day = 6. .axis logical (TRUE/FALSE), used request shortened cut labels axes. local.tz Used identifying whether date daylight savings time (DST) applied . Examples include local.tz = \"Europe/London\", local.tz = \"America/New_York\" .e. time zones assume DST. https://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones shows time zones valid systems. important original data GMT (UTC) fixed offset GMT. See import openair manual information import data ensure DST applied. latitude decimal latitude used type = \"daylight\". longitude decimal longitude. Note locations west Greenwich negative.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate common model evaluation statistics — modStats","text":"Returns data frame model evaluation statistics.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate common model evaluation statistics — modStats","text":"function development currently provides common model evaluation statistics. include (mathematically defined later): \\(n\\), number complete pairs data. \\(FAC2\\), fraction predictions within factor two. \\(MB\\), mean bias. \\(MGE\\), mean gross error. \\(NMB\\), normalised mean bias. \\(NMGE\\), normalised mean gross error. \\(RMSE\\), root mean squared error. \\(r\\), Pearson correlation coefficient. Note, can also supply argument method e.g. method = \"spearman\". Also returned P value correlation coefficient, \\(P\\), may present 0 low values. \\(COE\\), Coefficient Efficiency based Legates McCabe (1999, 2012). many suggestions measuring model performance years, COE simple formulation easy interpret. perfect model COE = 1. noted Legates McCabe although COE lower bound, value COE = 0.0 fundamental meaning. implies model able predict observed values observed mean. Therefore, since model can explain variation observed values can observed mean, model can predictive advantage. negative values COE, model less effective observed mean predicting variation observations. \\(IOA\\), Index Agreement based Willmott et al. (2011), spans -1 +1 values approaching +1 representing better model performance. IOA 0.5, example, indicates sum error-magnitudes one half sum observed-deviation magnitudes. IOA = 0.0, signifies sum magnitudes errors sum observed-deviation magnitudes equivalent. IOA = -0.5, indicates sum error-magnitudes twice sum perfect model-deviation observed-deviation magnitudes. Values IOA near -1.0 can mean model-estimated deviations O poor estimates observed deviations; , also can mean simply little observed variability - caution needed IOA approaches -1. statistics based complete pairs mod obs. Conditioning possible setting type, can vector e.g. type = c(\"weekday\", \"season\").","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate common model evaluation statistics — modStats","text":"Legates DR, McCabe GJ. (1999). Evaluating use goodness--fit measures hydrologic hydroclimatic model validation. Water Resources Research 35(1): 233-241. Legates DR, McCabe GJ. (2012). refined index model performance: rejoinder, International Journal Climatology. Willmott, C.J., Robeson, S.M., Matsuura, K., 2011. refined index model performance. International Journal Climatology.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate common model evaluation statistics — modStats","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/modStats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate common model evaluation statistics — modStats","text":"","code":"## the example below is somewhat artificial --- assuming the observed ## values are given by NOx and the predicted values by NO2. modStats(mydata, mod = \"no2\", obs = \"nox\") #> # A tibble: 1 × 12 #> default n FAC2 MB MGE NMB NMGE RMSE r P COE IOA #> #> 1 all data 63095 0.170 -130. 130. -0.725 0.726 167. 0.787 0 -0.337 0.331 ## evaluation stats by season modStats(mydata, mod = \"no2\", obs = \"nox\", type = \"season\") #> # A tibble: 4 × 12 #> season n FAC2 MB MGE NMB NMGE RMSE r P COE IOA #> #> 1 spring (… 17343 0.258 -108. 108. -0.685 0.685 140. 0.820 0 -0.250 0.375 #> 2 summer (… 14658 0.171 -116. 116. -0.705 0.705 145. 0.757 0 -0.420 0.290 #> 3 autumn (… 14775 0.0983 -154. 154. -0.753 0.753 192. 0.788 0 -0.437 0.281 #> 4 winter (… 16319 0.142 -143. 143. -0.749 0.751 185. 0.826 0 -0.321 0.340"},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":null,"dir":"Reference","previous_headings":"","what":"Example data for openair — mydata","title":"Example data for openair — mydata","text":"mydata dataset provided example dataset part openair package. dataset contains hourly measurements air pollutant concentrations, wind speed wind direction collected Marylebone (London) air quality monitoring supersite 1st January 1998 23rd June 2005. data set tibble.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example data for openair — mydata","text":"","code":"mydata"},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Example data for openair — mydata","text":"Data frame 65533 observations (rows) 10 variables: date Observation date/time stamp year-month-day hour:minute:second format (POSIXct). ws Wind speed, m/s, numeric vector. wd Wind direction, degrees North, numeric vector. nox Oxides nitrogen concentration, ppb, numeric vector. no2 Nitrogen dioxide concentration, ppb, numeric vector. o3 Ozone concentration, ppb, numeric vector. pm10 Particulate PM10 fraction measurement, ug/m3 (raw TEOM), numeric vector. so2 Sulfur dioxide concentration, ppb, numeric vector. co Carbon monoxide concentration, ppm, numeric vector. pm25 Particulate PM2.5 fraction measurement, ug/m3, numeric vector.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Example data for openair — mydata","text":"mydata compiled data archived London Air Quality Archive. See https://www.londonair.org.uk site details.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Example data for openair — mydata","text":"mydata supplied openair package example dataset use documented examples.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Example data for openair — mydata","text":"openair functions generally require data frames field \"date\" can either POSIXct Date format","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/mydata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example data for openair — mydata","text":"","code":"#basic structure head(mydata) #> # A tibble: 6 × 10 #> date ws wd nox no2 o3 pm10 so2 co pm25 #> #> 1 1998-01-01 00:00:00 0.6 280 285 39 1 29 4.72 3.37 NA #> 2 1998-01-01 01:00:00 2.16 230 NA NA NA 37 NA NA NA #> 3 1998-01-01 02:00:00 2.76 190 NA NA 3 34 6.83 9.60 NA #> 4 1998-01-01 03:00:00 2.16 170 493 52 3 35 7.66 10.2 NA #> 5 1998-01-01 04:00:00 2.4 180 468 78 2 34 8.07 8.91 NA #> 6 1998-01-01 05:00:00 3 190 264 42 0 16 5.50 3.05 NA"},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":null,"dir":"Reference","previous_headings":"","what":"Pre-defined openair colours and definition of user-defined colours — openColours","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"primarily internal openair function make easy users select particular colour schemes, define range colours user-defined length.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"","code":"openColours(scheme = \"default\", n = 100)"},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"scheme one pre-defined openair schemes (e.g., \"increment\") user-defined palette (e.g., c(\"red\", \"orange\", \"gold\")). See ?openColours full list available schemes. n number colours required.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"character vector hex codes","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"schemes","dir":"Reference","previous_headings":"","what":"Schemes","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"following schemes made available openColours(): Sequential Colours: \"default\", \"increment\", \"brewer1\", \"heat\", \"jet\", \"turbo\", \"hue\", \"greyscale\". Simplified versions viridis colours: \"viridis\", \"plasma\", \"magma\", \"inferno\", \"cividis\", \"turbo\". Simplified versions RColorBrewer sequential palettes: \"Blues\", \"BuGn\", \"BuPu\", \"GnBu\", \"Greens\", \"Greys\", \"Oranges\", \"OrRd\", \"PuBu\", \"PuBuGn\", \"PuRd\", \"Purples\", \"RdPu\", \"Reds\", \"YlGn\", \"YlGnBu\", \"YlOrBr\", \"YlOrRd\". Diverging Palettes: Simplified versions RColorBrewer diverging palettes: \"BrBG\", \"PiYG\", \"PRGn\", \"PuOr\", \"RdBu\", \"RdGy\", \"RdYlBu\", \"RdYlGn\", \"Spectral\". Qualitative Palettes: Simplified versions RColorBrewer qualitative palettes: \"Accent\", \"Dark2\", \"Paired\", \"Pastel1\", \"Pastel2\", \"Set1\", \"Set2\", \"Set3\". \"okabeito\" (\"cbPalette\"), colour-blind safe palette based work Masataka Okabe Kei Ito (https://jfly.uni-koeln.de/color/) \"tol.bright\" (\"tol\"), \"tol.muted\" \"tol.light\", colour-blind safe palettes based work Paul Tol (https://personal.sron.nl/~pault/) \"tableau\" \"observable\", aliases \"Tableau10\" (https://www.tableau.com/blog/colors-upgrade-tableau-10-56782) \"Observable10\" (https://observablehq.com/blog/crafting-data-colors) colour palettes. useful consistency openair plots figures made Tableau Observable Plot. UK Government Palettes: \"daqi\" \"daqi.bands\", colours associated UK daily air quality index; \"daqi\" (palette 10 colours, corresponding index value) \"daqi.bands\" (4 colours, corresponding band - Low, Moderate, High, High). colours taken directly https://uk-air.defra.gov.uk/air-pollution/daqi may useful figures like calendarPlot(). \"gaf.cat\", \"gaf.focus\" \"gaf.seq\", colours recommended UK Government Analysis function (https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours--charts/). \"gaf.cat\" return 'categorical' palette (max 6 colours), \"gaf.focus\" 'focus' palette (max 2 colours), \"gaf.seq\" 'sequential' palette.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"way many schemes developed exist certain number colour gradations (typically 3–10) — see ?brewer.pal actual details. less required number colours supplied openair interpolate colours. pre-defined schemes merits use depend particular situation. showing incrementing concentrations, e.g., high concentrations emphasised, \"default\", \"heat\", \"jet\", \"turbo\", \"increment\" useful. See also description RColorBrewer schemes option scheme. colour-code categorical-type problems, e.g., colours different pollutants, \"hue\" \"brewer1\" useful. publishing black white, \"greyscale\" often convenient. openair functions, well generating greyscale colour gradient, also resets strip background coloured text lines greyscale values. Failing , user can define schemes based R colour names. see full list names, type colors() R.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"https://colorbrewer2.org/ https://uk-air.defra.gov.uk/air-pollution/daqi https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-colours--charts/","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"David Carslaw Jack Davison","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openColours.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pre-defined openair colours and definition of user-defined colours — openColours","text":"","code":"# to return 5 colours from the \"jet\" scheme: cols <- openColours(\"jet\", 5) cols #> [1] \"#00007F\" \"#007FFF\" \"#7FFF7F\" \"#FF7F00\" \"#7F0000\" # to interpolate between named colours e.g. 10 colours from yellow to # green to red: cols <- openColours(c(\"yellow\", \"green\", \"red\"), 10) cols #> [1] \"#FFFF00\" \"#C6FF00\" \"#8DFF00\" \"#55FF00\" \"#1CFF00\" \"#1CE200\" \"#54AA00\" #> [8] \"#8D7100\" \"#C63800\" \"#FF0000\""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":null,"dir":"Reference","previous_headings":"","what":"openair: Tools for the Analysis of Air Pollution Data — openair-package","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"Tools analyse, interpret understand air pollution data. Data typically regular time series air quality measurement, meteorological data dispersion model output can analysed. package described Carslaw Ropkins (2012, doi:10.1016/j.envsoft.2011.09.008 ) subsequent papers.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"UK Natural Environment Research Council (NERC) funded knowledge exchange project aims make available innovative analysis tools air pollution data; additional support Defra. tools generally developed analyse data hourly resolution (least regular time series) air pollution monitoring dispersion modelling. availability meteorological data time resolution greatly enhances capabilities tools. openair contains collection functions analyse air pollution data. Typically expected data hourly means, although functions consider time periods. principal aim make available analysis techniques users air quality data model output normally access . functions consist developed authors growing number researchers. package also provides access wide range data sources including UK Automatic Urban Rural Network (AURN), networks run King's College London (e.g. LAQN) Scottish Air Quality Network (SAQN). package number requirements input data discussed manual (available openair website https://davidcarslaw.github.io/openair/). key requirements date date-time field must name date' (can \\code{Date} \\code{POSIXct} format), wind speed represented ws' wind direction `wd'. functions work straightforward way, offer many options finer control perhaps -depth analysis. openair package depends several packages written people function properly. ensure packages available, need installed, requires connection internet. packages required come R base system. problems automatic download packages, see https://davidcarslaw.github.io/openair/ details. NOTE: openair assumes data expressed local time 'Daylight Saving Time' used. functions check case issue warning TRUE. recommended data expressed UTC/GMT (fixed offset ) avoid potential problems R openair functions. openair manual provides advice issues (available website). check see openair correctly installed, try examples .","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"the-openair-class","dir":"Reference","previous_headings":"","what":"The openair class","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"well generating plots , openair plotting functions also return object class “openair”. object includes three main components: call, command used generate plot. data, data frame summarised information used make plot. plot, plot . retained, e.g., using output <- polarPlot(mydata, \"nox\"), output can used recover data, reproduce rework original plot undertake analysis. openair output can manipulated using number generic operations, including print, plot summary. examples show examples using openair object.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"reference details given specific functions. principal reference users may also wish cite manual (details contained manual ). Carslaw, D.C. K. Ropkins, (2012) openair — R package air quality data analysis. Environmental Modelling & Software. Volume 27-28, 52-61.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"Maintainer: David Carslaw david.carslaw@york.ac.uk (ORCID) Authors: Jack Davison jack.davison@ricardo.com (ORCID) Karl Ropkins K.Ropkins@.leeds.ac.uk (ORCID)","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/openair-package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"openair: Tools for the Analysis of Air Pollution Data — openair-package","text":"","code":"if (FALSE) { # \\dontrun{ # load package library(openair) # summarise data in a compact way summaryPlot(mydata) # traditional wind rose windRose(mydata) # polar plot polar_nox <- polarPlot(mydata, pollutant = \"nox\") # see call polar_nox$call # get data polar_nox$data # could, e.g., re-plot in {ggplot2} library(ggplot2) ggplot(polar_nox$data, aes(u, v, fill = z)) + geom_tile() + coord_equal() + scale_fill_gradientn(colours = openair::openColours(), na.value = NA) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to plot percentiles by wind direction — percentileRose","title":"Function to plot percentiles by wind direction — percentileRose","text":"percentileRose plots percentiles wind direction flexible conditioning. plot can display multiple percentile lines filled areas.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to plot percentiles by wind direction — percentileRose","text":"","code":"percentileRose( mydata, pollutant = \"nox\", wd = \"wd\", type = \"default\", percentile = c(25, 50, 75, 90, 95), smooth = FALSE, method = \"default\", cols = \"default\", angle = 10, mean = TRUE, mean.lty = 1, mean.lwd = 3, mean.col = \"grey\", fill = TRUE, intervals = NULL, angle.scale = 45, auto.text = TRUE, key.header = NULL, key.footer = \"percentile\", key.position = \"bottom\", key = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to plot percentiles by wind direction — percentileRose","text":"mydata data frame minimally containing wd numeric field plot — pollutant. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". one pollutant can supplied e.g. pollutant = c(\"no2\", \"o3\") provided one type. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. percentile percentile value(s) plot. Must 0–100. percentile = NA mean line shown. smooth wind direction data smoothed using cyclic spline? method method = \"default\" supplied percentiles wind direction calculated. method = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples wind sector y mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. angle Default angle “spokes” smooth = FALSE. mean Show mean wind direction line? mean.lty Line type mean line. mean.lwd Line width mean line. mean.col Line colour mean line. fill percentile intervals filled (default) lines drawn (fill = FALSE). intervals User-supplied intervals scale e.g. intervals = c(0, 10, 30, 50) angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData lattice:xyplot. example, percentileRose passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common graphical arguments, xlim ylim plotting ranges lwd line thickness using fill = FALSE, passed xyplot, although local modifications may applied openair. example, axis title labelling options (xlab, ylab main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to plot percentiles by wind direction — percentileRose","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to plot percentiles by wind direction — percentileRose","text":"percentileRose calculates percentile levels pollutant plots wind direction. One percentile levels can calculated displayed either filled areas lines. wind directions rounded nearest 10 degrees, consistent surface data UK Met Office smooth fitted. levels wind direction optionally calculated using cyclic smooth cubic spline using option smooth. smooth = FALSE data shown 10 degree sectors. percentileRose function compliments similar functions including windRose, pollutionRose, polarFreq polarPlot. useful showing distribution concentrations wind direction often can reveal different sources e.g. affect high percentile concentrations chimney stack. Similar functions, flexible conditioning available type option. easy example consider multiple percentile values pollutant season, year . See examples . percentileRose also offers great flexibility scale used user fine control range, interval colour.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Function to plot percentiles by wind direction — percentileRose","text":"Ashbaugh, L.L., Malm, W.C., Sadeh, W.Z., 1985. residence time probability analysis sulfur concentrations ground canyon national park. Atmospheric Environment 19 (8), 1263-1270.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to plot percentiles by wind direction — percentileRose","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/percentileRose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to plot percentiles by wind direction — percentileRose","text":"","code":"# basic percentile plot percentileRose(mydata, pollutant = \"o3\") # 50/95th percentiles of ozone, with different colours percentileRose(mydata, pollutant = \"o3\", percentile = c(50, 95), col = \"brewer1\") if (FALSE) { # \\dontrun{ # percentiles of ozone by year, with different colours percentileRose(mydata, type = \"year\", pollutant = \"o3\", col = \"brewer1\") # percentile concentrations by season and day/nighttime.. percentileRose(mydata, type = c(\"season\", \"daylight\"), pollutant = \"o3\", col = \"brewer1\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":null,"dir":"Reference","previous_headings":"","what":"Bivariate polarAnnulus plot — polarAnnulus","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"Typically plots concentration pollutant wind direction function time annulus. function good visualising concentrations pollutants vary wind direction time period e.g. month, day week.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"","code":"polarAnnulus( mydata, pollutant = \"nox\", resolution = \"fine\", local.tz = NULL, period = \"hour\", type = \"default\", statistic = \"mean\", percentile = NA, limits = NULL, cols = \"default\", width = \"normal\", min.bin = 1, exclude.missing = TRUE, date.pad = FALSE, force.positive = TRUE, k = c(20, 10), normalise = FALSE, key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"mydata data frame minimally containing date, wd pollutant. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). resolution Two plot resolutions can set: “normal” “fine” (default). local.tz results calculated local time includes treatment daylight savings time (DST)? default consider DST issues, provided data imported without DST offset. Emissions activity tends occur local time e.g. rush hour 8 every day. clocks go forward spring, emissions effectively released atmosphere typically 1 hour earlier summertime .e. DST applies. plotting diurnal profiles, effect “smearing-” concentrations. Sometimes, useful approach express time local time. correction tends produce better-defined diurnal profiles concentration (variables) allows better comparison made emissions/activity data. set FALSE GMT used. Examples usage include local.tz = \"Europe/London\", local.tz = \"America/New_York\". See cutData import details. period determines temporal period consider. Options “hour” (default, plot diurnal variations), “season” plot variation throughout year, “weekday” plot day week variation “trend” plot trend wind direction. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"site\") produce 2x2 plot split season site. use two types mostly meant situations several sites. Note, two types provided first forms columns second rows. Also note polarAnnulus function type/period combinations forbidden make little sense. example, type = \"season\" period = \"trend\" (result plot many gaps sensible smoothing), type = \"weekday\" period = \"weekday\". statistic statistic applied wind speed/direction bin. Can “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean” “cpf” (Conditional Probability Function). smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean. percentile statistic = \"percentile\" statistic = \"cpf\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. width width annulus; can “normal” (default), “thin” “fat”. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. date.pad type = \"trend\" (default), date.pad = TRUE pad-missing data beginning first year end last year. purpose ensure trend plot begins ends beginning end year. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing value supplied gam temporal wind direction components, respectively. cases e.g. trend plot less 1-year data smoothing default values may become noisy affected outliers. Choosing lower value k (say 10) may help produce better plot. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:levelplot cutData. example, polarAnnulus passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed levelplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"polarAnnulus function shares many properties polarPlot. However, polarAnnulus focussed displaying information concentrations pollutant (values another variable) vary wind direction time. Plotting annulus helps reduce compression information towards centre plot. circular plot easy interpret wind direction easily understood polar rather Cartesian coordinates. inner part annulus represents earliest time outer part annulus latest time. time dimension can shown many ways including \"trend\", \"hour\" (hour day), \"season\" (month year) \"weekday\" (day week). Taking hour example, plot show concentrations vary hour day wind direction. plots can useful understanding different source influences affect location. type = \"trend\" amount smoothing vary linearly length time series .e. certain amount smoothing per unit interval time. deliberate choice one interested subset (time) data, detail provided subset compared full data set. allows users investigate specific periods detail. Full flexibility given smoothing parameter k.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarAnnulus.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bivariate polarAnnulus plot — polarAnnulus","text":"","code":"# diurnal plot for PM10 at Marylebone Rd if (FALSE) polarAnnulus(mydata, pollutant = \"pm10\", main = \"diurnal variation in pm10 at Marylebone Road\") # \\dontrun{} # seasonal plot for PM10 at Marylebone Rd if (FALSE) polarAnnulus(mydata, poll=\"pm10\", period = \"season\") # \\dontrun{} # trend in coarse particles (PMc = PM10 - PM2.5), calculate PMc first mydata$pmc <- mydata$pm10 - mydata$pm25 if (FALSE) polarAnnulus(mydata, poll=\"pmc\", period = \"trend\", main = \"trend in pmc at Marylebone Road\") # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":null,"dir":"Reference","previous_headings":"","what":"K-means clustering of bivariate polar plots — polarCluster","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Function identifying clusters bivariate polar plots (polarPlot()); identifying clusters original data subsequent processing.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-means clustering of bivariate polar plots — polarCluster","text":"","code":"polarCluster( mydata, pollutant = \"nox\", x = \"ws\", wd = \"wd\", n.clusters = 6, after = NA, cols = \"Paired\", angle.scale = 315, units = x, auto.text = TRUE, plot = TRUE, plot.data = FALSE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-means clustering of bivariate polar plots — polarCluster","text":"mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". one pollutant can chosen. x Name variable plot wind direction polar coordinates, default wind speed, “ws”. wd Name wind direction field. n.clusters Number clusters use. n.clusters length 1, lattice panel plot output showing clusters identified one n.clusters. function can applied differences polar plot surfaces (see polarDiff details). data frame supplied, clustering carried differences mydata way polarDiff. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. plot.data default, data component polarCluster() contains original data frame appended new \"cluster\" column. plot.data = TRUE, data component instead contains data reproduce clustered polar plot (similar data returned polarPlot()). may useful re-plotting polarCluster() plot ways. ... Arguments passed polarPlot type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-means clustering of bivariate polar plots — polarCluster","text":"openair object. object includes four main components: call, command used generate plot; data, default original data frame new field cluster identifying cluster, clust_stats giving contributions made cluster number measurements, percentage percentage pollutant; plot, plot . Note rows value pollutant NA ignored returned data frame may fewer rows original. clustering carried considering differences, .e., data frame supplied, output also includes data frame cluster identified.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Bivariate polar plots generated using polarPlot function provide useful graphical technique identifying characterising different air pollution sources. bivariate polar plots provide useful graphical indication potential sources, location wind-speed variable dependence, several limitations. Often, `feature' detected plot subsequent analysis data meeting particular wind speed/direction criteria based judgement investigator concerning wind speed-direction intervals interest. Furthermore, identification feature can depend choice colour scale used, making process somewhat arbitrary. polarCluster applies Partition Around Medoids (PAM) clustering techniques polarPlot() surfaces help identify potentially interesting features analysis. Details PAM can found cluster package (core R package pre-installed R systems). PAM clustering similar k-means several advantages e.g. robust outliers. clustering based equal contribution assumed u v wind components associated concentration. data standardized clustering takes place. function works best first trying different numbers clusters plotting . achieved setting n.clusters length 1. example, n.clusters = 2:10 plot output showing 9 cluster levels 2 10. clustering can also applied differences polar plot surfaces (see polarDiff()). case second data frame () supplied. Note clustering computationally intensive function can take long time run — particularly number clusters increased. reason can good idea run clusters first get feel e.g. n.clusters = 2:5. number clusters decided, user can run polarCluster return original data frame together new column cluster, gives cluster number character (see example). Note rows value pollutant NA ignored returned data frame may fewer rows original. Note automatic ways ensuring appropriate number clusters application dependent. However, often -priori information available different features polar plots correspond . Nevertheless, appropriateness different clusters best determined post-processing data. Carslaw Beevers (2012) paper discusses issues detail. Note unlike openair functions single type “default” allowed.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"K-means clustering of bivariate polar plots — polarCluster","text":"Carslaw, D.C., Beevers, S.D, Ropkins, K M.C. Bell (2006). Detecting quantifying aircraft -airport contributions ambient nitrogen oxides vicinity large international airport. Atmospheric Environment. 40/28 pp 5424-5434. Carslaw, D.C., & Beevers, S.D. (2013). Characterising understanding emission sources using bivariate polar plots k-means clustering. Environmental Modelling & Software, 40, 325-329. doi:10.1016/j.envsoft.2012.09.005","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-means clustering of bivariate polar plots — polarCluster","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarCluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-means clustering of bivariate polar plots — polarCluster","text":"","code":"if (FALSE) { # \\dontrun{ ## plot 2-8 clusters. Warning! This can take several minutes... polarCluster(mydata, pollutant = \"nox\", n.clusters = 2:8) # basic plot with 6 clusters results <- polarCluster(mydata, pollutant = \"nox\", n.clusters = 6) ## get results, could read into a new data frame to make it easier to refer to ## e.g. results <- results$data... head(results$data) ## how many points are there in each cluster? table(results$data$cluster) ## plot clusters 3 and 4 as a timeVariation plot using SAME colours as in ## cluster plot timeVariation(subset(results$data, cluster %in% c(\"3\", \"4\")), pollutant = \"nox\", group = \"cluster\", col = openColours(\"Paired\", 6)[c(3, 4)] ) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":null,"dir":"Reference","previous_headings":"","what":"Polar plots considering changes in concentrations between two time periods — polarDiff","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"function provides way showing differences concentrations two time periods polar plot. several uses function, common see source(s) may changed two periods.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"","code":"polarDiff( before, after, pollutant = \"nox\", x = \"ws\", limits = NULL, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"data frame represents \"\" case. See polarPlot() details different input requirements. data frame represents \"\" case. See polarPlot() details different input requirements. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). pair-wise statistics Pearson correlation regression techniques plotted, pollutant takes two elements . example, pollutant = c(\"bc\", \"pm25\") \"bc\" function \"pm25\". x Name variable plot wind direction polar coordinates, default wind speed, “ws”. limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... Arguments passed polarPlot mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"openair plot.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"function primarily intended compare two time periods location, can used two data sets contain pollutant. example, data two sites close one another, two co-located instruments. analysis works calculating polar plot surface periods subtracting surface surface.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarDiff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Polar plots considering changes in concentrations between two time periods — polarDiff","text":"","code":"if (FALSE) { # \\dontrun{ before_data <- selectByDate(mydata, year = 2002) after_data <- selectByDate(mydata, year = 2003) polarDiff(before_data, after_data, pollutant = \"no2\") # with some options polarDiff(before_data, after_data, pollutant = \"no2\", cols = \"RdYlBu\", limits = c(-20, 20)) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"polarFreq primarily plots wind speed-direction frequencies ‘bins’. bin colour-coded depending frequency measurements. Bins can also used show concentration pollutants using range commonly used statistics.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"","code":"polarFreq( mydata, pollutant = NULL, statistic = \"frequency\", ws.int = 1, wd.nint = 36, grid.line = 5, breaks = NULL, cols = \"default\", trans = TRUE, type = \"default\", min.bin = 1, ws.upper = NA, offset = 10, border.col = \"transparent\", key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"mydata data frame minimally containing ws, wd date. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\" statistic statistic applied wind speed/direction bin. Can “frequency”, “mean”, “median”, “max” (maximum), “stdev” (standard deviation) “weighted.mean”. option “frequency” (default) simplest plots frequency wind speed/direction different bins. scale therefore shows counts bin. option “mean” plot mean concentration pollutant (see next point) wind speed/direction bins, . Finally, “weighted.mean” plot concentration pollutant weighted wind speed/direction. segment therefore provides percentage overall contribution total concentration. information given examples. Note options “frequency”, necessary also provide name pollutant. See function cutData details. ws.int Wind speed interval assumed. cases e.g. low met mast, interval 0.5 may appropriate. wd.nint Number intervals wind direction. grid.line Radial spacing grid lines. breaks user can provide scale. breaks expects sequence numbers define range scale. sequence represent one equal spacing e.g. breaks = seq(0, 100, 10) - scale 0-10 intervals 10, flexible sequence e.g. breaks = c(0, 1, 5, 7, 10), may useful situations. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. trans transformation applied? Sometimes producing plots kind can dominated high points. default therefore TRUE square-root transform applied. results non-linear scale (usually) better representation distribution. set FALSE linear scale used. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. ws.upper user-defined upper wind speed use. useful ensuring consistent scale different plots. example, always ensure wind speeds displayed 1-10, set ws.int = 10. offset offset controls size ‘hole’ middle expressed percentage maximum wind speed. Setting higher offset e.g. 50 useful statistic = \"weighted.mean\" ws.int greater maximum wind speed. See example . border.col colour boundary wind speed/direction bin. default transparent. Another useful choice sometimes \"white\". key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:xyplot cutData. example, polarFreq passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"polarFreq default use provides details wind speed direction frequencies. respect similar windRose, considers wind direction intervals 10 degrees user-specified wind speed interval. frequency wind speeds/directions formed ‘bins’ represented colour scale. polarFreq function flexible either windRose() polarPlot(). can, example, also consider pollutant concentrations (see examples ). Instead number data points bin, concentration can shown. , range statistics can used describe bin - see statistic . Plotting mean concentrations useful source identification polarPlot() without smoothing, may preferable data. Plotting statistic = \"weighted.mean\" particularly useful understanding relative importance different source contributions. example, high mean concentrations may observed high wind speed conditions, weighted mean concentration may well show contribution overall concentrations low. polarFreq also offers great flexibility scale used user fine control range, interval colour.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarFreq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to plot wind speed/direction frequencies and other statistics — polarFreq","text":"","code":"# basic wind frequency plot polarFreq(mydata) # wind frequencies by year if (FALSE) polarFreq(mydata, type = \"year\") # \\dontrun{} # mean SO2 by year, showing only bins with at least 2 points if (FALSE) polarFreq(mydata, pollutant = \"so2\", type = \"year\", statistic = \"mean\", min.bin = 2) # \\dontrun{} # weighted mean SO2 by year, showing only bins with at least 2 points if (FALSE) polarFreq(mydata, pollutant = \"so2\", type = \"year\", statistic = \"weighted.mean\", min.bin = 2) # \\dontrun{} #windRose for just 2000 and 2003 with different colours if (FALSE) polarFreq(subset(mydata, format(date, \"%Y\") %in% c(2000, 2003)), type = \"year\", cols = \"turbo\") # \\dontrun{} # user defined breaks from 0-700 in intervals of 100 (note linear scale) if (FALSE) polarFreq(mydata, breaks = seq(0, 700, 100)) # \\dontrun{} # more complicated user-defined breaks - useful for highlighting bins # with a certain number of data points if (FALSE) polarFreq(mydata, breaks = c(0, 10, 50, 100, 250, 500, 700)) # \\dontrun{} # source contribution plot and use of offset option if (FALSE) polarFreq(mydata, pollutant = \"pm25\", statistic =\"weighted.mean\", offset = 50, ws.int = 25, trans = FALSE) # \\dontrun{}"},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Function for plotting bivariate polar plots with smoothing. — polarPlot","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"Function plotting pollutant concentration polar coordinates showing concentration wind speed (another numeric variable) direction. Mean concentrations calculated wind speed-direction ‘bins’ (e.g. 0-1, 1-2 m/s,... 0-10, 10-20 degrees etc.). aid interpretation, gam smoothing carried using mgcv.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"","code":"polarPlot( mydata, pollutant = \"nox\", x = \"ws\", wd = \"wd\", type = \"default\", statistic = \"mean\", limits = NULL, exclude.missing = TRUE, uncertainty = FALSE, percentile = NA, cols = \"default\", weights = c(0.25, 0.5, 0.75), min.bin = 1, mis.col = \"grey\", upper = NA, angle.scale = 315, units = x, force.positive = TRUE, k = 100, normalise = FALSE, key.header = statistic, key.footer = pollutant, key.position = \"right\", key = TRUE, auto.text = TRUE, ws_spread = 1.5, wd_spread = 5, x_error = NA, y_error = NA, kernel = \"gaussian\", formula.label = TRUE, tau = 0.5, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"mydata data frame minimally containing wd, another variable plot polar coordinates (default column “ws” — wind speed) pollutant. also contain date plots time period required. pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". can also one pollutant specified e.g. pollutant = c(\"nox\", \"no2\"). main use using two pollutants model evaluation two species expected similar concentrations. saves user stacking data possible work columns data directly. typical use pollutant = c(\"obs\", \"mod\") compare two columns “obs” (observations) “mod” (modelled values). pair-wise statistics Pearson correlation regression techniques plotted, pollutant takes two elements . example, pollutant = c(\"bc\", \"pm25\") \"bc\" function \"pm25\". x Name variable plot wind direction polar coordinates, default wind speed, “ws”. wd Name wind direction field. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. statistic statistic applied wind speed/direction bin. smoothing involved, colour scale statistics provide indication overall pattern interpreted concentration units e.g. statistic = \"weighted.mean\" bin mean multiplied bin frequency divided total frequency. many cases using polarFreq better. Setting statistic = \"weighted.mean\" can useful provides indication concentration * frequency occurrence highlight wind speed/direction conditions dominate overall mean.Can : “mean” (default), “median”, “max” (maximum), “frequency”. “stdev” (standard deviation), “weighted.mean”. statistic = \"nwr\" Implements Non-parametric Wind Regression approach Henry et al. (2009) uses kernel smoothers. openair implementation identical Gaussian kernels used wind direction speed. smoothing controlled ws_spread wd_spread. statistic = \"cpf\" conditional probability function (CPF) plotted single (usually high) percentile level supplied. CPF defined CPF = /ny, number samples y bin (default wind direction, wind speed interval) mixing ratios greater overall percentile concentration, ny total number samples wind sector (see Ashbaugh et al., 1985). Note percentile intervals can also considered; see percentile details. statistic = \"r\" statistic = \"Pearson\", Pearson correlation coefficient calculated two pollutants. calculation involves weighted Pearson correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. statistic = \"Spearman\", Spearman correlation coefficient calculated two pollutants. calculation involves weighted Spearman correlation coefficient, weighted Gaussian kernels wind direction radial variable (default wind speed). weight assigned values close wind speed-direction interval. Kernel weighting used ensure data used rather relying potentially small number values wind speed-direction interval. \"robust_slope\" another option pair-wise statistics \"quantile.slope\", uses quantile regression estimate slope particular quantile level (see also tau setting quantile level). \"york_slope\" another option pair-wise statistics uses York regression method estimate slope. method uncertainties x y used determination slope. uncertainties provided x_error y_error — see . limits function best choose sensible limits automatically. However, circumstances user wish set different ones. example series plots showing year data separately. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. exclude.missing Setting option TRUE (default) removes points plot far original data. smoothing routines produce predictions points data exist .e. predict. removing points far original data produces plot clear original data lie. set FALSE missing data interpolated. uncertainty uncertainty calculated surface shown? TRUE three plots produced scale showing predicted surface together estimated lower upper uncertainties 95% confidence interval. Calculating uncertainties useful understand whether features real . example, high wind speeds data greater uncertainty predicted values. uncertainties calculated using GAM weighting done frequency measurements wind speed-direction bin. Note uncertainties calculated type set \"default\". percentile statistic = \"percentile\" percentile used, expressed 0 100. Note percentile value calculated wind speed, wind direction ‘bins’. reason can also useful set min.bin ensure sufficient number points available estimate percentile. See quantile details percentiles calculated. percentile also used Conditional Probability Function (CPF) plots. percentile can length two, case percentile interval considered use CPF. example, percentile = c(90, 100) plot CPF concentrations 90 100th percentiles. Percentile intervals can useful identifying specific sources. addition, percentile can also length 3. third value ‘trim’ value applied. calculating percentile intervals many can cover low values useful information. trim value ensures values greater equal trim * mean value considered percentile intervals calculated. effect extract detail many source signatures. See manual examples. Finally, trim value less zero percentile range interpreted absolute concentration values subsetting carried directly. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\"). cols can also take values \"viridis\", \"magma\", \"inferno\", \"plasma\" viridis colour maps ported Python's Matplotlib library. weights edges plot may data points wind speed-direction interval, situations distort plot concentrations high. weights applies weighting reduce influence. example default single data point exists weighting factor 0.25 two points 0.5. apply weighting use data , use weights = c(1, 1, 1). alternative -weighting points can removed altogether using min.bin. min.bin minimum number points allowed wind speed/wind direction bin. default 1. value two requires least 2 valid records bin ; bins less 2 valid records set NA. Care taken using value > 1 risk removing real data points. recommended consider data care. Also, polarFreq function can use circumstances. mis.col min.bin > 1 can useful show data removed plots. done shading missing data mis.col. highlight missing data min.bin > 1 choose mis.col = \"transparent\". upper sets upper limit wind speed used. Often relatively data points high wind speeds plotting can reduce useful information plot. angle.scale Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale value 0 360 degrees mitigate problems. example angle.scale = 45 draw scale heading NE direction. units units shown polar axis scale. force.positive default TRUE. Sometimes smoothing data steep gradients possible predicted values negative. force.positive = TRUE ensures predictions remain positive. useful several reasons. First, lots missing data interpolation needed can result artefacts predictions far original data. Second, known beforehand data positive, option carries assumption prediction. likely time setting force.positive = FALSE background concentrations first subtracted resulting data legitimately negative. vast majority situations expected user need alter default option. k smoothing parameter used gam function package mgcv. Typically, value around 100 (default) seems suitable resolve important features plot. appropriate choice k problem-dependent; extensive testing polar plots many different problems suggests value k 100 suitable. Setting k higher values tend affect surface predictions much add computation time. Lower values k increase smoothing. Sometimes data plot polarPlot fail. circumstances can worth lowering value k. normalise TRUE concentrations normalised dividing mean value. done fitting smooth surface. option particularly useful one interested patterns concentrations several pollutants different scales e.g. NOx CO. Often useful one pollutant chosen. key.header Adds additional text/labels scale key. example, passing options key.header = \"header\", key.footer = \"footer1\" adds addition text scale key. arguments passed drawOpenKey via quickText, applying auto.text argument, handle formatting. key.footer see key.footer. key.position Location scale key plotted. Allowed arguments currently include \"top\", \"right\", \"bottom\" \"left\". key Fine control scale key via drawOpenKey. See drawOpenKey details. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting `2' NO2. ws_spread value sigma used Gaussian kernel weighting wind speed statistic = \"nwr\" correlation regression statistics used r. Default 0.5. wd_spread value sigma used Gaussian kernel weighting wind direction statistic = \"nwr\" correlation regression statistics used r. Default 4. x_error x error / uncertainty used statistic = \"york_slope\". y_error y error / uncertainty used statistic = \"york_slope\". kernel Type kernel used weighting procedure correlation regression techniques used. \"gaussian\" supported may enhanced future. formula.label pair-wise statistics regression slopes calculated plotted, formula label displayed? formula.label also determine whether concentration information printed statistic = \"cpf\". tau quantile estimated statistic set \"quantile.slope\". Default 0.5 equal median ignored \"quantile.slope\" used. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto lattice:levelplot cutData. example, polarPlot passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, common axis title labelling options (xlab, ylab, main) passed levelplot via quickText handle routine formatting.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"openair object. data contains four set columns: cond, conditioning based type; u v, translational vectors based ws wd; local pollutant estimate.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"bivariate polar plot useful diagnostic tool quickly gaining idea potential sources. Wind speed one useful variables use separate source types (see references). example, ground-level concentrations resulting buoyant plumes chimney stacks tend peak higher wind speed conditions. Conversely, ground-level, non-buoyant plumes road traffic, tend highest concentrations low wind speed conditions. sources aircraft engines also show differing characteristics wind speed. function developed allow variables wind speed plotted wind direction polar coordinates. key issue variable plotted wind direction discriminating way. example, temperature can help reveal high-level sources brought ground level unstable atmospheric conditions, show effect source emission dependent temperature e.g. biogenic isoprene. plots can vary considerably depending much smoothing done. approach adopted based flexible capable mgcv package uses Generalized Additive Models. methods exist find optimum level smoothness, necessarily useful. principal aim polarPlot graphical analysis rather quantitative purposes. respect smoothing aims strike balance revealing interesting (real) features overly noisy data. defaults used polarPlot() based analysis data many different sources. advanced users may wish modify code adopt smoothing approaches. Various statistics possible consider e.g. mean, maximum, median. statistic = \"max\" often useful revealing sources. Pair-wise statistics two pollutants can also calculated. function can also used compare two pollutant species range pair-wise statistics (see help statistic) Grange et al. (2016) (open-access publication link ). Wind direction split 10 degree intervals variable (e.g. wind speed) 30 intervals. 2D bins used calculate statistics. plots often show interesting features higher wind speeds (see references ). conditions can measurements therefore greater uncertainty calculation surface. several ways issue can tackled. First, possible avoid smoothing altogether use polarFreq(). Second, effect setting minimum number measurements wind speed-direction bin can examined min.bin. possible single point high wind speed conditions can strongly affect surface prediction. Therefore, setting min.bin = 3, example, remove wind speed-direction bins fewer 3 measurements fitting surface. Third, consider setting uncertainty = TRUE. option show predicted surface together upper lower 95% confidence intervals, take account frequency measurements. Variants polarPlot include polarAnnulus() polarFreq().","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"Ashbaugh, L.L., Malm, W.C., Sadeh, W.Z., 1985. residence time probability analysis sulfur concentrations ground canyon national park. Atmospheric Environment 19 (8), 1263-1270. Carslaw, D.C., Beevers, S.D, Ropkins, K M.C. Bell (2006). Detecting quantifying aircraft -airport contributions ambient nitrogen oxides vicinity large international airport. Atmospheric Environment. 40/28 pp 5424-5434. Carslaw, D.C., & Beevers, S.D. (2013). Characterising understanding emission sources using bivariate polar plots k-means clustering. Environmental Modelling & Software, 40, 325-329. doi:10.1016/j.envsoft.2012.09.005 Henry, R.C., Chang, Y.S., Spiegelman, C.H., 2002. Locating nearby sources air pollution nonparametric regression atmospheric concentrations wind direction. Atmospheric Environment 36 (13), 2237-2244. Henry, R., Norris, G.., Vedantham, R., Turner, J.R., 2009. Source region identification using Kernel smoothing. Environ. Sci. Technol. 43 (11), 4090e4097. http:// dx.doi.org/10.1021/es8011723. Uria-Tellaetxe, . D.C. Carslaw (2014). Source identification using conditional bivariate Probability function. Environmental Modelling & Software, Vol. 59, 1-9. Westmoreland, E.J., N. Carslaw, D.C. Carslaw, . Gillah E. Bates (2007). Analysis air quality within street canyon using statistical dispersion modelling techniques. Atmospheric Environment. Vol. 41(39), pp. 9195-9205. Yu, K.N., Cheung, Y.P., Cheung, T., Henry, R.C., 2004. Identifying impact large urban airports local air quality nonparametric regression. Atmospheric Environment 38 (27), 4501-4507. Grange, S. K., Carslaw, D. C., & Lewis, . C. 2016. Source apportionment advances bivariate polar plots, correlation, regression techniques. Atmospheric Environment. 145, 128-134. https://www.sciencedirect.com/science/article/pii/S1352231016307166","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/polarPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function for plotting bivariate polar plots with smoothing. — polarPlot","text":"","code":"# Use openair 'mydata' # basic plot polarPlot(openair::mydata, pollutant = \"nox\") if (FALSE) { # \\dontrun{ # polarPlots by year on same scale polarPlot(mydata, pollutant = \"so2\", type = \"year\", main = \"polarPlot of so2\") # set minimum number of bins to be used to see if pattern remains similar polarPlot(mydata, pollutant = \"nox\", min.bin = 3) # plot by day of the week polarPlot(mydata, pollutant = \"pm10\", type = \"weekday\") # show the 95% confidence intervals in the surface fitting polarPlot(mydata, pollutant = \"so2\", uncertainty = TRUE) # Pair-wise statistics # Pearson correlation polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"r\") # Robust regression slope, takes a bit of time polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"robust.slope\") # Least squares regression works too but it is not recommended, use robust # regression # polarPlot(mydata, pollutant = c(\"pm25\", \"pm10\"), statistic = \"slope\") } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":null,"dir":"Reference","previous_headings":"","what":"Pollution rose variation of the traditional wind rose plot — pollutionRose","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"traditional wind rose plot plots wind speed wind direction different intervals. pollution rose applies plot structure substitutes measurements, commonly pollutant time series, wind speed.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"","code":"pollutionRose( mydata, pollutant = \"nox\", key.footer = pollutant, key.position = \"right\", key = TRUE, breaks = 6, paddle = FALSE, seg = 0.9, normalise = FALSE, alpha = 1, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"mydata data frame containing fields ws wd pollutant Mandatory. pollutant name corresponding variable data frame supplied e.g. pollutant = \"nox\". key.footer Adds additional text/labels scale key. See key.header information. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. key Fine control scale key via drawOpenKey(). breaks commonly, number break points pollutant concentrations. default, 6, attempts breaks supplied data approximately 6 sensible break points. However, breaks can also used set specific break points. example, argument breaks = c(0, 1, 10, 100) breaks data segments <1, 1-10, 10-100, >100. paddle Either TRUE FALSE. TRUE plots rose using 'paddle' style spokes. FALSE plots rose using 'wedge' style spokes. seg paddle = TRUE, seg determines width segments. example, seg = 0.5 produce segments 0.5 * angle. normalise TRUE wind direction segment normalised equal one. useful showing concentrations (parameters) contribute wind sector proportion time wind direction low. line showing probability wind directions particular wind sector also shown. alpha alpha transparency use plotting surface (value 0 1 zero fully transparent 1 fully opaque). Setting value 1 can useful plotting surfaces map using package openairmaps. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... Arguments passed windRose ws Name column representing wind speed. wd Name column representing wind direction. ws2,wd2 user can supply second set wind speed wind direction values first can compared. See pollutionRose() details. ws.int Wind speed interval. Default 2 m/s low met masts low mean wind speeds value 1 0.5 m/s may better. angle Default angle “spokes” 30. potentially useful angles 45 10. Note width wind speed interval may need adjusting using width. type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. calm.thresh default, conditions considered calm wind speed zero. user can set different threshold calms setting calm.thresh higher value. example, calm.thresh = 0.5 identify wind speeds 0.5 calm. bias.corr angle divide exactly 360 bias introduced frequencies wind direction already supplied rounded nearest 10 degrees, often case. example, angle = 22.5, N, E, S, W include 3 wind sectors angles two. bias correction can made correct problem. simple method according Applequist (2012) used adjust frequencies. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet”, “hue” user defined. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\", \"black\"). grid.line Grid line interval use. NULL, default, assigned based available data range. However, can also forced specific value, e.g. grid.line = 10. grid.line can also list control interval, line type colour. example grid.line = list(value = 10, lty = 5, col = \"purple\"). width paddle = TRUE, adjustment factor width wind speed intervals. example, width = 1.5 make paddle width 1.5 times wider. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly, e.g., subscripting ‘2’ NO2. offset size 'hole' middle plot, expressed percentage polar axis scale, default 10. max.freq Controls scaling used setting maximum value radial limits. useful ensure several plots use radial limits. key.header Adds additional text/labels scale key. example, passing windRose(mydata, key.header = \"ws\") adds addition text scale header. Note: argument passed drawOpenKey() via quickText(), applying auto.text argument, handle formatting. dig.lab number significant figures scientific number formatting used break point key labelling. Default 5. include.lowest Logical. FALSE (default), first interval left exclusive right inclusive. TRUE, first interval left right inclusive. Passed include.lowest argument cut(). statistic statistic applied data bin plot. Options currently include “prop.count”, “prop.mean” “abs.count”. default “prop.count” sizes bins according proportion frequency measurements. Similarly, “prop.mean” sizes bins according relative contribution mean. “abs.count” provides absolute count measurements bin. annotate TRUE percentage calm mean values printed panel together description statistic plot. \" \" statistic plot. Custom annotations may added setting value c(\"annotation 1\", \"annotation 2\"). angle.scale scale default shown 315 degree angle. Sometimes placement scale may interfere interesting feature. user can therefore set angle.scale another value (0 360 degrees) mitigate problems. example angle.scale = 45 draw scale heading NE direction. border Border colour shaded areas. Default border.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"openair object. Summarised proportions can extracted directly using $data operator, e.g. object$data output <- windRose(mydata). returns data frame three set columns: cond, conditioning based type; wd, wind direction; calm, statistic proportion data unattributed specific wind direction collected calm conditions; several (one range binned plot) columns giving proportions measurements associated ws pollutant range plotted discrete panel.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"pollutionRose() windRose() wrapper brings pollutant forward argument list, attempts sensibly rescale break points based pollutant data range -passing ws.int. default, pollutionRose() plot pollution rose nox using \"wedge\" style segments placing scale key right plot. possible compare two wind speed-direction data sets using pollutionRose(). many reasons e.g. see one site compares another meteorological model evaluation. case, ws wd considered reference data sets second set wind speed wind directions compared (ws2 wd2). first set values subtracted second differences compared. example, wd2 biased positive compared wd pollutionRose show bias polar coordinates. default use, wind direction bias colour-coded show negative bias one colour positive bias another.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/pollutionRose.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pollution rose variation of the traditional wind rose plot — pollutionRose","text":"","code":"# pollutionRose of nox pollutionRose(mydata, pollutant = \"nox\") ## source apportionment plot - contribution to mean if (FALSE) { # \\dontrun{ pollutionRose(mydata, pollutant = \"pm10\", type = \"year\", statistic = \"prop.mean\") } # } ## example of comparing 2 met sites ## first we will make some new ws/wd data with a postive bias mydata$ws2 = mydata$ws + 2 * rnorm(nrow(mydata)) + 1 mydata$wd2 = mydata$wd + 30 * rnorm(nrow(mydata)) + 30 ## need to correct negative wd id <- which(mydata$wd2 < 0) mydata$wd2[id] <- mydata$wd2[id] + 360 ## results show postive bias in wd and ws pollutionRose(mydata, ws = \"ws\", wd = \"wd\", ws2 = \"ws2\", wd2 = \"wd2\")"},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic text formatting for openair — quickText","title":"Automatic text formatting for openair — quickText","text":"Workhorse function automatically applies routine text formatting common expressions data names used openair.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic text formatting for openair — quickText","text":"","code":"quickText(text, auto.text = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic text formatting for openair — quickText","text":"text character vector. auto.text logical option. default, TRUE, applies quickText text returns result. alternative, FALSE, returns text unchanged. (number openair functions enable/disable quickText using option.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic text formatting for openair — quickText","text":"function returns expression graphical evaluation.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatic text formatting for openair — quickText","text":"quickText routine formatting lookup table. screens supplied character vector text automatically applies formatting recognised character sub-series. function used number openair functions can also used directly users format text components graphs (see ).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic text formatting for openair — quickText","text":"Karl Ropkins.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/quickText.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic text formatting for openair — quickText","text":"","code":"#example 1 ##see axis formatting in an openair plot, e.g.: scatterPlot(mydata, x = \"no2\", y = \"pm10\") #example 2 ##using quickText in other plots plot(mydata$no2, mydata$pm10, xlab = quickText(\"my no2 label\"), ylab = quickText(\"pm10 [ ug.m-3 ]\"))"},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate rollingMean values — rollingMean","title":"Calculate rollingMean values — rollingMean","text":"Calculate rollingMean values taking account data capture thresholds","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate rollingMean values — rollingMean","text":"","code":"rollingMean( mydata, pollutant = \"o3\", width = 8, new.name = \"rolling\", data.thresh = 75, align = \"centre\", ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate rollingMean values — rollingMean","text":"mydata data frame containing date field. mydata must contain date field Date POSIXct format. input time series must regular e.g. hourly, daily. pollutant name pollutant e.g. pollutant = \"o3\". width averaging period (rolling window width) use e.g. width = 8 generate 8-hour rolling mean values hourly data analysed. new.name name given new rollingMean variable. supplied create name based name pollutant averaging period used. data.thresh data capture threshold %. values calculated data capture period interest less value. example, width = 8 data.thresh = 75 least 6 hours required calculate mean, else NA returned. align specifies moving window aligned. \"right\" means previous hours (including current) averaged. seems default UK air quality rolling mean statistics. \"left\" means forward hours averaged, \"centre\" \"center\", default. ... arguments, currently unused.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate rollingMean values — rollingMean","text":"utility function mostly designed calculate rolling mean statistics relevant pollutant limits e.g. 8 hour rolling means ozone 24 hour rolling means PM10. However, function general use helping display rolling mean values flexible ways e.g. rolling window width left, right centre aligned. function try fill missing time gaps get full time sequence return data frame number rows supplied.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate rollingMean values — rollingMean","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/rollingMean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate rollingMean values — rollingMean","text":"","code":"## rolling 8-hour mean for ozone mydata <- rollingMean(mydata, pollutant = \"o3\", width = 8, new.name = \"rollingo3\", data.thresh = 75, align = \"right\")"},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":null,"dir":"Reference","previous_headings":"","what":"Rolling regression for pollutant source characterisation. — runRegression","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"function calculates rolling regressions input data set window width. principal use function identify \"dilution lines\" ratio two pollutant concentrations invariant. original idea based work Bentley (2004).","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"","code":"runRegression(mydata, x = \"nox\", y = \"pm10\", run.len = 3, date.pad = TRUE)"},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"mydata data frame columns date least two variables use regression. x column name x variable use linear regression y = m.x + c. y column name y variable use linear regression y = m.x + c. run.len window width used rolling regression. value 3 example hourly data consider 3 one-hour time sequences. date.pad gaps time series filled calculations made?","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"tibble date calculated regression coefficients information plot dilution lines.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"intended use apply approach air pollution data extract consecutive points time ratio two pollutant concentrations changes little. filtering output high R2 values (typically 0.90 0.95), conditions local source dilution dominant can isolated post processing. function fully described used openair online manual, together examples.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"original inspiration: Bentley, S. T. (2004). Graphical techniques constraining estimates aerosol emissions motor vehicles using air monitoring network data. Atmospheric Environment,(10), 1491–1500. https://doi.org/10.1016/j.atmosenv.2003.11.033 Example vehicle emissions high time resolution data: Farren, N. J., Schmidt, C., Juchem, H., Pöhler, D., Wilde, S. E., Wagner, R. L., Wilson, S., Shaw, M. D., & Carslaw, D. C. (2023). Emission ratio determination road vehicles using range remote emission sensing techniques. Science Total Environment, 875. https://doi.org/10.1016/j.scitotenv.2023.162621.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/runRegression.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Rolling regression for pollutant source characterisation. — runRegression","text":"","code":"# Just use part of a year of data output <- runRegression(selectByDate(mydata, year = 2004, month = 1:3), x = \"nox\", y = \"pm10\", run.len = 3) output #> # A tibble: 2,073 × 12 #> date date_start date_end intercept slope #> #> 1 2004-01-01 01:00:00 2004-01-01 00:00:00 2004-01-01 02:00:00 47.4 -0.199 #> 2 2004-01-01 02:00:00 2004-01-01 01:00:00 2004-01-01 03:00:00 2.15 0.0996 #> 3 2004-01-01 03:00:00 2004-01-01 02:00:00 2004-01-01 04:00:00 1.87 0.0898 #> 4 2004-01-01 04:00:00 2004-01-01 03:00:00 2004-01-01 05:00:00 2.39 0.0897 #> 5 2004-01-01 05:00:00 2004-01-01 04:00:00 2004-01-01 06:00:00 -10.6 0.297 #> 6 2004-01-01 06:00:00 2004-01-01 05:00:00 2004-01-01 07:00:00 20.0 -0.167 #> 7 2004-01-01 07:00:00 2004-01-01 06:00:00 2004-01-01 08:00:00 8.76 0.0129 #> 8 2004-01-01 08:00:00 2004-01-01 07:00:00 2004-01-01 09:00:00 5.81 0.0596 #> 9 2004-01-01 09:00:00 2004-01-01 08:00:00 2004-01-01 10:00:00 0.108 0.113 #> 10 2004-01-01 10:00:00 2004-01-01 09:00:00 2004-01-01 11:00:00 -5.59 0.149 #> # ℹ 2,063 more rows #> # ℹ 7 more variables: r_squared , nox_1 , nox_2 , pm10_1 , #> # pm10_2 , delta_nox , delta_pm10 "},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":null,"dir":"Reference","previous_headings":"","what":"Flexible scatter plots — scatterPlot","title":"Flexible scatter plots — scatterPlot","text":"Scatter plots conditioning three main approaches: conventional scatterPlot, hexagonal binning kernel density estimates. former also options fitting smooth fits linear models uncertainties shown.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flexible scatter plots — scatterPlot","text":"","code":"scatterPlot( mydata, x = \"nox\", y = \"no2\", z = NA, method = \"scatter\", group = NA, avg.time = \"default\", data.thresh = 0, statistic = \"mean\", percentile = NA, type = \"default\", smooth = FALSE, spline = FALSE, linear = FALSE, ci = TRUE, mod.line = FALSE, cols = \"hue\", plot.type = \"p\", key = TRUE, key.title = group, key.columns = 1, key.position = \"right\", strip = TRUE, log.x = FALSE, log.y = FALSE, x.inc = NULL, y.inc = NULL, limits = NULL, windflow = NULL, y.relation = \"same\", x.relation = \"same\", ref.x = NULL, ref.y = NULL, k = NA, dist = 0.02, map = FALSE, auto.text = TRUE, plot = TRUE, ... )"},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flexible scatter plots — scatterPlot","text":"mydata data frame containing least two numeric variables plot. x Name x-variable plot. Note x can date field factor. example, x can one openair built types \"year\" \"season\". y Name numeric y-variable plot. z Name numeric z-variable plot method = \"scatter\" method = \"level\". Note method = \"scatter\" points coloured according continuous colour scale, whereas method = \"level\" surface coloured. method Methods include “scatter” (conventional scatter plot), “hexbin” (hexagonal binning using hexbin package). “level” binned smooth surface plot “density” (2D kernel density estimates). group grouping variable use, . Setting variable data frame effect plotting several series panel using different symbols/colours etc. set variable character factor, categories factor levels used directly. set numeric variable, split variable quantiles. avg.time defines time period average . Can “sec”, “min”, “hour”, “day”, “DSTday”, “week”, “month”, “quarter” “year”. much increased flexibility number can precede options followed space. example, timeAverage 2 months period = \"2 month\". See function timeAverage details . option se useful one method number points plotted reduced .e. choosing longer averaging time. data.thresh data capture threshold use (\\ data using avg.time. value zero means available data used particular period regardless number values available. Conversely, value 100 mean data need present average calculated, else recorded NA. used avg.time = \"default\". statistic statistic apply aggregating data; default mean. Can one \"mean\", \"max\", \"min\", \"median\", \"frequency\", \"sd\", \"percentile\". Note \"sd\" standard deviation \"frequency\" number (frequency) valid records period. \"percentile\" percentile level (\\ \"percentile\" option - see . used avg.time = \"default\". percentile percentile level percent used statistic = \"percentile\" aggregating data avg.time. default 95. used avg.time = \"default\". type type determines data split .e. conditioned, plotted. default produce single plot using entire data. Type can one built-types detailed cutData e.g. “season”, “year”, “weekday” . example, type = \"season\" produce four plots — one season. also possible choose type another variable data frame. variable numeric, data split four quantiles (possible) labelled accordingly. type existing character factor variable, categories/levels used directly. offers great flexibility understanding variation different variables depend one another. Type can length two e.g. type = c(\"season\", \"weekday\") produce 2x2 plot split season day week. Note, two types provided first forms columns second rows. smooth smooth line fitted data TRUE; optionally 95 percent confidence intervals shown. method = \"level\" smooth surface fitted binned data. spline smooth spline fitted data TRUE. particularly useful fewer data points connection line sequence points required. linear linear model fitted data TRUE; optionally 95 percent confidence intervals shown. equation line R2 value also shown. ci confidence intervals smooth/linear fit shown? mod.line TRUE three lines added scatter plot help inform model evaluation. 1:1 line solid 1:0.5 1:2 lines dashed. Together lines help show close group points 1:1 relationship also show points within factor two (FAC2). mod.line appropriately transformed x y axes log scale. cols Colours used plotting. Options include “default”, “increment”, “heat”, “jet” RColorBrewer colours — see openair openColours function details. user defined user can supply list colour names recognised R (type colours() see full list). example cols = c(\"yellow\", \"green\", \"blue\") plot.type lattice plot type. Can “p” (points — default), “l” (lines) “b” (lines points). key key drawn? default TRUE. key.title title key (used). key.columns Number columns used key. many pollutants single column can make key wide. user can thus choose use several columns setting columns less number pollutants. key.position Location scale key plotted. Allowed arguments currently include “top”, “right”, “bottom” “left”. strip strip drawn? default TRUE. log.x x-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. log.y y-axis appear log scale? default FALSE. TRUE well-formatted log10 scale used. can useful checking linearity logged. x.inc x-interval used binning data method = \"level\". y.inc y-interval used binning data method = \"level\". limits method = \"level\" function best choose sensible limits automatically. However, circumstances user wish set different ones. limits set form c(lower, upper), limits = c(0, 100) force plot limits span 0-100. windflow option allows scatter plot show wind speed/direction shows arrow. option list e.g. windflow = list(col = \"grey\", lwd = 2, scale = 0.1). option requires wind speed (ws) wind direction (wd) available. maximum length arrow plotted fraction plot dimension longest arrow scale plot x-y dimension. Note, plot size adjusted manually user re-plotted ensure correct wind angle. list may contain options panel.arrows lattice package. useful options include length, controls length arrow head angle, controls angle arrow head. option works best many data ensure -plotting become problem. y.relation determines y-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. x.relation determines x-axis scale plotted. “” ensures panels use scale “free” use panel-specific scales. latter useful setting plotting data different values. ref.x See ref.y details. ref.y list details horizontal lines added representing reference line(s). example, ref.y = list(h = 50, lty = 5) add dashed horizontal line 50. Several lines can plotted e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c(\"green\", \"blue\")). See panel.abline lattice package details adding/controlling lines. k Smoothing parameter supplied gam fitting smooth surface method = \"level\". dist plotting smooth surfaces (method = \"level\" smooth = TRUE, dist controls far original data predictions made. See exclude..far mgcv package. Data first transformed unit square. Values 0 1. map base map drawn? option development. auto.text Either TRUE (default) FALSE. TRUE titles axis labels automatically try format pollutant names units properly e.g. subscripting ‘2’ NO2. plot plot produced? FALSE can useful analysing data extract plot components plotting ways. ... graphical parameters passed onto cutData appropriate lattice plot function (xyplot, levelplot hexbinplot depending method). example, scatterPlot passes option hemisphere = \"southern\" cutData provide southern (rather default northern) hemisphere handling type = \"season\". Similarly, default case method = \"scatter\" common axis title labelling options (xlab, ylab, main) passed xyplot via quickText handle routine formatting. common graphical parameters, e.g. layout panel arrangement, pch plot symbol lwd lty line width type, also available (see examples ). method = \"hexbin\" can useful transform scale dominated high values. possible supplying two functions: one applies transformation inverses . log scaling (default) example, trans = function(x) log(x) inv = function(x) exp(x). square root transform use trans = sqrt inv = function(x) x^2. carry transformation options trans = NULL inv = NULL used.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flexible scatter plots — scatterPlot","text":"openair object","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Flexible scatter plots — scatterPlot","text":"scatterPlot() basic function plotting scatter plots flexible ways openair. flexible enough consider lots conditioning variables takes care fitting smooth linear relationships data. four main ways plotting relationship two variables, set using method option. default \"scatter\" plot conventional scatterPlot. cases lots data -plotting becomes problem, method = \"hexbin\" method = \"density\" can useful. former requires hexbin package installed. also method = \"level\" bin x y data according intervals set x.inc y.inc colour bins according levels third variable, z. Sometimes however, far better understanding relationship three variables (x, y z) gained fitting smooth surface data. See examples . smooth fit shown smooth = TRUE can help show overall form data e.g. whether relationship appears linear . Also, linear fit can shown using linear = TRUE option. user fine control choice colours symbol type used. Another way reducing number points used plots can sometimes useful aggregate data. example, hourly data can aggregated daily data. See timePlot() examples . default plots shown colour key bottom case conditioning, strips top plot. Sometimes may overkill user can opt remove key /strip setting key /strip FALSE. One reason maximise plotting area therefore information shown.","code":""},{"path":[]},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Flexible scatter plots — scatterPlot","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/scatterPlot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Flexible scatter plots — scatterPlot","text":"","code":"# load openair data if not loaded already dat2004 <- selectByDate(mydata, year = 2004) # basic use, single pollutant scatterPlot(dat2004, x = \"nox\", y = \"no2\") if (FALSE) { # \\dontrun{ # scatterPlot by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\") } # } # scatterPlot by day of the week, removing key at bottom scatterPlot(dat2004, x = \"nox\", y = \"no2\", type = \"weekday\", key = FALSE) # example of the use of continuous where colour is used to show # different levels of a third (numeric) variable # plot daily averages and choose a filled plot symbol (pch = 16) # select only 2004 if (FALSE) { # \\dontrun{ scatterPlot(dat2004, x = \"nox\", y = \"no2\", z = \"co\", avg.time = \"day\", pch = 16) # show linear fit, by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE) # do the same, but for daily means... scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE, avg.time = \"day\") # log scales scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", smooth = FALSE, linear = TRUE, avg.time = \"day\", log.x = TRUE, log.y = TRUE) # also works with the x-axis in date format (alternative to timePlot) scatterPlot(mydata, x = \"date\", y = \"no2\", avg.time = \"month\", key = FALSE) ## multiple types and grouping variable and continuous colour scale scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", type = c(\"season\", \"weekend\")) # use hexagonal binning library(hexbin) # basic use, single pollutant scatterPlot(mydata, x = \"nox\", y = \"no2\", method = \"hexbin\") # scatterPlot by year scatterPlot(mydata, x = \"nox\", y = \"no2\", type = \"year\", method = \"hexbin\") ## bin data and plot it - can see how for high NO2, O3 is also high scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", method = \"level\", dist = 0.02) ## fit surface for clearer view of relationship - clear effect of ## increased O3 scatterPlot(mydata, x = \"nox\", y = \"no2\", z = \"o3\", method = \"level\", x.inc = 10, y.inc = 2, smooth = TRUE) } # }"},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset a data frame based on date — selectByDate","title":"Subset a data frame based on date — selectByDate","text":"Utility function make easier select periods data frame sending function","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset a data frame based on date — selectByDate","text":"","code":"selectByDate( mydata, start = \"1/1/2008\", end = \"31/12/2008\", year = 2008, month = 1, day = \"weekday\", hour = 1 )"},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset a data frame based on date — selectByDate","text":"mydata data frame containing date field hourly high resolution format. start start date string form d/m/yyyy e.g. “1/2/1999” ‘R’ format .e. “YYYY-mm-dd”, “1999-02-01” end See start format. year year years select e.g. year = 1998:2004 select 1998-2004 inclusive year = c(1998, 2004) select 1998 2004. month month months select. Can either numeric e.g. month = 1:6 select months 1-6 (January June), name e.g. month = c(\"January\", \"December\"). Names can abbreviated 3 letters lower upper case. day day name days select. day can numeric (1 31) character. example day = c(\"Monday\", \"Wednesday\") day = 1:10 (select 1st 10th month). Names can abbreviated 3 letters lower upper case. Also accepts “weekday” (Monday - Friday) “weekend” convenience. hour hour hours select 0-23 e.g. hour = 0:12 select hours 0 12 inclusive.","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subset a data frame based on date — selectByDate","text":"function makes much easier select periods interest data frame based dates British format. Selecting date/times R format can intimidating new users. function can used select quite complex dates simply - see examples . Dates assumed inclusive, start = \"1/1/1999\" means times selected hour zero. Similarly, end = \"31/12/1999\" include hours 31st December. start end can also standard R format string .e. \"YYYY-mm-dd\", start = \"1999-01-01\" fine. options applied turn making possible select quite complex dates","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset a data frame based on date — selectByDate","text":"David Carslaw","code":""},{"path":"https://davidcarslaw.github.io/openair/reference/selectByDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subset a data frame based on date — selectByDate","text":"","code":"## select all of 1999 data.1999 <- selectByDate(mydata, start = \"1/1/1999\", end = \"31/12/1999\") head(data.1999) #> # A tibble: 6 × 10 #> date ws wd nox no2 o3 pm10 so2 co pm25 #>