The openair manual - openair project

2 downloads 203 Views 25MB Size Report
Carslaw, D.C. and K. Ropkins, (2012). openair — an R package for air qual- ...... R will of course need to be installe
The openair manual

open-source tools for analysing air pollution )

What should happen is that in the R console the coordinates are given for that point. In my case these were x = 0.503 and y = 0.338. These coordinates can now be used as the basis of adding some text or other annotation. In the example below, the grid.text function is used to add some text for these coordinates making the font bigger (cex = 2), bold (font = 2) and blue (col = "blue"). grid.text(x = 0.503, y = 0.338, label = "here!", gp = gpar(cex = 2, font = 2, col = "blue"))

Even with this basic approach, some sophisticated annotation is possible with any openair plot. There are many other functions that can be used from the grid package that would allow for polygons, segments and other features to be drawn is a similar way to the examples earlier in this section. Continuing with the same example, here is how to add an arrow pointing to the maximum NOx concentration shown on the top plot for Saturday (again using the grid.locator function). grid.lines(x = c(0.736, 0.760), y = c(0.560, 0.778), arrow = arrow()) grid.text(x = 0.736, y = 0.560, label = "maximum", just = "left")

8.9 Getting help The principal place for seeking help with openair functions is through the software itself. The document you are reading will increasingly give the background to the ideas and wider information. Also, the package itself will always contain the most up to date help. Furthermore, the process of building and checking packages is strict. For example, it is checked to see if all the options in a function match with descriptions in the help files, and all examples given in the help (and there are many) are run to ensure they all work. Nevertheless, the options shown for each function in this document

80

8 Introduction

 

FIGURE 8.4 The help screen for the function polarPlot.

are parsed directly from the openair package ensuring consistency between this document and the package help. To bring up the general help page (assuming you have loaded openair), type ?openair, which will bring up the main openair page, from which there are links to all functions. Similarly, if you want help with a specific function more directly, type something like ?polarPlot. The help screen will provide the most up to date information on the function including: a short description, a description of all the options, a more detailed description and links to other similar functions. Importantly, each function help will have several examples given of its use, which are easily reproducible; just copy them into R. These examples use the , full.names = TRUE), function(.file) importADMS(.file)) all.met >CONTROL"), bat.file, col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE) x