Saves an EDA Graphical and Statistical Summary
Saves the output from function inset
as a graphics file in the R Working Directory for use in report or map preparation. Optionally the EDA graphics may be plotted with base 10 logarithmic scaling.
inset.exporter(x, xlab = deparse(substitute(x)), log = FALSE, xlim = NULL, nclass = NULL, ifnright = TRUE, file = NULL, table.cex = 0.7, gtype = "emf", ...)
x |
name of the variable to be plotted. |
xlab |
a label for the x-axis. It is often desirable to replace the default x-axis label of the input variable name text string with a more informative label, e.g., |
log |
to display the data with logarithmic (x-axis) scaling, set |
xlim |
default limits of the x-axis are determined in the function. However when used stand-alone the limits may be user-defined by setting |
nclass |
the default procedure for preparing the histogram is to use the Scott (1979) rule. This usually provides an informative histogram, other optional rules are |
ifnright |
controls where the sample size is plotted in the histogram display, by default this in the upper right corner of the plot. If the data distribution is such that the upper left corner would be preferable, set |
file |
the name of the folder where the files are to be saved, a ‘/’ is appended before the synthesized file name, details of which are displayed on the current device. If no file is specified, the files are saved to the Working Directory, see Details below. |
table.cex |
controls the size of the text in the central panel of summary statistics table, the default is |
gtype |
the format of the graphics file to be saved. By default |
... |
further arguments to be passed to methods. For example, by default individual data points in the CPP plot are marked by a plus sign, |
See inset
for details concerning the inset
parameters.
The graphics file will be saved, by default, in the Working Directory. Alternately a folder name may be provided in file
. The file name is synthesized from the data frame name, ‘_inset_’, the variable name and ‘.gtype
’. This is prefixed with a ‘\’ and concatenated with the folder location.
The synthesis of the file name uses the data frame name which it is assumed is located in search()
position [[2]]
.
Sometimes the table between the two plots my be left and/or right truncated, or incompletely displayed. Reducing the size of the graphics window will lead to a complete display. If this needs to be done the function needs to be repeated to ensure a correctly dimensioned display is saved. Once as a complete saved graphics file the image may be resized in the receiving document.
Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df
.
Any NAs in the data vector are removed prior to displaying and saving the plot.
If the default selection for xlim
is inappropriate it can be set, e.g., xlim = c(0, 200)
or c(2, 200)
, the latter being apprpriate for a logarithmically scaled plot, i.e. log = TRUE
. If the defined limits lie within the observed data range a truncated plot will be displayed. If this occurs the number of data points omitted is displayed below the total number of observations.
In some R installations the generation of multi-panel displays and the use of function eqscplot from package MASS causes warning messages related to graphics parameters to be displayed on the current device. These may be suppressed by entering options(warn = -1)
on the R command line, or that line may be included in a ‘first’ function prepared by the user that loads the ‘rgr’ package, etc.
Robert G. Garrett
Venables, W.N. and Ripley, B.D., 2001. Modern Applied Statistsis with S-Plus, 3rd Edition, Springer, 501 p. See pp. 119 for a description of histogram bin selection computations.
## Make test data available data(kola.o) attach(kola.o) ## Usage is as follows ## Saves the graphics as a pdf file to the defined folde.r ## inset.exporter(Cu, xlab = "Cu (mg/kg) in\n<2 mm O-horizon soil", ## log = TRUE, gtype = "pdf", file = "D://R_work//Project3") ## Detach test data detach(kola.o)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.