11.07.2015 Views

Package 'openair'

Package 'openair'

Package 'openair'

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

102 scatterPlot... Other graphical parameters are passed onto cutData and an appropriate latticeplot function (xyplot, levelplot or hexbinplot depending on method). Forexample, scatterPlot passes the option hemisphere = "southern" on tocutData to provide southern (rather than default northern) hemisphere handlingof type = "season". Similarly, for the default case method = "scatter"common axis and title labelling options (such as xlab, ylab, main) are passed toxyplot via quickText to handle routine formatting. Other common graphicalparameters, e.g. layout for panel arrangement, pch for plot symbol and lwdand lty for line width and type, as also available (see examples below).DetailsThe scatterPlot is the basic function for plotting scatterPlots in flexible ways in openair. It isflexible enough to consider lots of conditioning variables and takes care of fitting smooth or linearrelationships to the data.There are four main ways of plotting the relationship between two variables, which are set usingthe method option. The default "scatter" will plot a conventional scatterPlot. In caseswhere there are lots of data and over-plotting becomes a problem, then method = "hexbin" ormethod = "density" can be useful. The former requires the hexbin package to be installed.There is also a method = "level" which will bin the x and y data according to the intervals set forx.inc and y.inc and colour the bins according to levels of a third variable, z. Sometimes however,a far better understanding of the relationship between three variables (x, y and z) is gained by fittinga smooth surface through the data. See examples below.A smooth fit is shown if smooth = TRUE which can help show the overall form of the data e.g.whether the relationship appears to be linear or not. Also, a linear fit can be shown using linear = TRUEas an option.The user has fine control over the choice of colours and symbol type used.Another way of reducing the number of points used in the plots which can sometimes be useful isto aggregate the data. For example, hourly data can be aggregated to daily data. See timePlot forexamples here.By default plots are shown with a colour key at the bottom and in the case of conditioning, strips onthe top of each plot. Sometimes this may be overkill and the user can opt to remove the key and/orthe strip by setting key and/or strip to FALSE. One reason to do this is to maximise the plottingarea and therefore the information shown.ValueAs well as generating the plot itself, scatterPlot also returns an object of class “openair”. Theobject includes three main components: call, the command used to generate the plot; data, thedata frame of summarised information used to make the plot; and plot, the plot itself. If retained,e.g. using output

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!