rp.firth {rpanel} | R Documentation |
This function gives access to a sampling scenario which is based on the mapping radioactivity and the calculation of a radionuclide inventory within a water body. (A ‘firth’ is a Scottish term for a long, narrow indentation of the sea coast at the mouth of a river.) Interest lies in nuclides which, on release into a water body, attach (absorb) to sediment in a manner which depends on the sediment particle size. Cobalt-60 and caesium-137 are examples of nuclides which exhibit this behaviour. In this sampling scenario, the map of sediment type is used to define regions of different particle size from which the sediment samples will be collected by grabs from a boat. The presence of strata therefore has to be considered, as the different types of material on the sea bed may affect the mean values of the measurements taken.
The function displays a map and gives graphical control over a variety of sampling strategies. Once the user has drawn a sample, some simple predictions over the whole firth can be produced. The geoR
package is used to construct these predictions.
rp.firth(hscale = NA, col.palette = rev(heat.colors(40)), col.se = "blue", file = NA, parameters = NA, sleep = 0.5)
hscale |
a scaling parameter which expands (>1) or contracts (<1) the size of the plot within the panel. This can be useful for projection onto a screen, for example. The vertical scale is set to the same value as the horizontal scale, to ensure that the plot is square. The default values are 1 on Unix platforms and 1.4 on Windows platforms. |
col.palette |
the colour palette used to display the predicted and true spatial surfaces. |
col.se |
the colour used to draw the standard error contours on the predicted surface. |
file |
the name of a file to which the sampled data will be written. |
parameters |
a list which can be used to change the parameters which control the simulated measurement data. |
sleep |
the duration in seconds of a pause while the necessary internal information is loaded into the panel. See Details. |
The use of the function is discussed in the paper referenced below.
Once the data have been sampled, a data file may be saved for further analysis external to the rp.firth
function, using the file
argument. A convenient way of saving to the current working directory, for example to a file named firth.dmp
, is to set the file
argument to file.path(getwd(), "firth.dmp")
. The load
function can then be applied to the saved file to create an object called mururoa.data
, which is a three-column matrix with the x and y locations in columns 1 and 2 and the observed values in column 3.
On some machines the R
and Tcl/Tk code can become out of step because of the time taken to initialise panel with the large amount of internal information required for plotting. The sleep
argument allows a pause for this to be completed before further rpanel
instructions are executed. If the rpanel
window displays with very small size, try increasing the value of sleep
.
Nothing.
Bowman, A.W., Crawford, E., Alexander, G. Gibson and Bowman, R.W. (2007). rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
Bowman, A.W., Gibson, I., Scott, E.M. and Crawford, E. (2008). Interactive Teaching Tools for Spatial Sampling. Technical report, available from the rpanel web page at www.stats.gla.ac.uk/~rpanel.
if (interactive()) { rp.firth() }