profiler {GCDkit} | R Documentation |
Plotting geochemical profiles. As a x axis can be specified an arbitrary variable or an numerical interval (for equidistant measurements).
profiler(x = NULL, y = NULL, data = WR, method = "Variable", legend = FALSE, pch = 1, col.lines = "black", col = "black", cex = 1, xaxs = "r", yaxs = "i", main = "",xmin = NULL, xmax = NULL, ...)
x |
character; optional name of variable to be plotted as x axis. |
y |
character; name(s) of variable(s) for individual profiles. |
data |
numeric; a matrix with the data. |
method |
character; which of the methods is to be used? Valid are "Variable","Equidistant" or "From-To". |
legend |
logical; should be plotted also legend (in a separate window)? |
pch |
plotting symbols specification. |
col.lines |
colour(s) for connecting lines. |
col |
plotting colour(s). |
cex |
numeric; relative size of the plotting symbols. |
xaxs, yaxs |
character; type of the axes.
See |
main |
character; main title for the plot |
xmin, xmax |
range of the x axis (for methods ' |
... |
any additional parameters for the function |
The function 'profiler
' serves for plotting three different types of
profiles involving a single or several geochemical parameters.
The first one, 'Variable
' uses any numeric variable as the x axis
(e.g., SiO2 contents, depth...). It is in fact a special type of a binary plot,
in which the data points are, for each of the y-axis variables, joined by a line.
The remaining two methods are very similar to each other. The x axis is in both cases equidistant, and the order of the individual samples follows from their sequence in the data set.
The method 'Equidistant
' uses simply the sequence number of the
individual samples in the data set. It does not label the x-axis,
just prints the number of samples used for plotting.
The method 'From/To
' serves for drawing equidistant profiles, where
the x axis can be specified by an interval.
In the specification of the x axis (for the method 'Variable
')
or any of the y variables (all methods) can be used also arithmetic
expressions, see calcCore
for the correct syntax.
If not called from the command prompt, the samples can be selected based on
combination of three searching mechanisms (by sample name/label, range or a
Boolean condition) - see selectSubset
for details.
The easiest way to specify the variable(s) to be plotted on individual profile(s) is to type directly the names of the columns, separated by commas. Alternatively can be used their sequence numbers or ranges. Also built-in lists can be employed, such as 'LILE', 'REE', 'major' and 'HFSE' or their combinations with the column names.
These lists are simple character vectors, and additional ones can be built by the user (see Examples). Note that currently only a single, stand-alone, user-defined list can be employed as a search criterion.
If the function is not called from the command prompt, and it desired so, the symbols and colours for each of the profiles can be specified separately in a simple spreadsheet-like interface.
If x axis occurs among the arguments to be plotted as y axes, it is skipped.
Likewise the relative scaling of the plotting symbols and the scale of the y axis can be specified.
Lastly, the user is asked to enter the limits for the axes, which are always two numbers separated by a comma.
results |
numeric matrix with the values for individual profiles. |
Vojtěch Janoušek, vojtech.janousek@geology.cz
data(sazava) accessVar("sazava") # Profiles of SiO2 versus (scaled) TiO2, MgO and K2O # if x is specified, method="Variable" is assumed automatically profiler("Na2O+K2O",c("TiO2","6*MgO","SiO2"), pch = c("+","o","@"), col = c("red","blue","darkgreen"), col.lines = c("red","blue","darkgreen"), xmin = 2, xmax = 6, legend=TRUE) # Equidistant profiles of (scaled) MgO, CaO, and Al2O3 (in sample sequence) # with specified symbols, scaling and line styles profiler(y = c("MgO","3*CaO","2*Al2O3"), method="Equidistant", col = "black", pch = 15, cex = 1.5, col.lines = c("red","blue","darkgreen"), legend = TRUE, lwd = 3) # just lines profiler(y = c("MgO","3*CaO","2*Al2O3"), method="Equidistant", col = "transparent", col.lines = c("red","blue","darkgreen"), legend = TRUE, lwd = 3) # Equidistant profiles of two calculated variables in custom colour # and user-defined plotting symbols; range of the x axis will be specified # interactively profiler(y = c("2*MgO","10*(Na2O+K2O)"), method = "From-To", pch = 1:2, col = c("blue","red"), cex = 1.5, main = "My plot", xmin = 10,xmax = 30,legend = TRUE)