spider {GCDkit} | R Documentation |
Normalization of trace-element data by the given standard and spiderplot plotting.
spider.individual(new=TRUE) spider.contour(chondrit = selectNorm(),what=NULL, colour.palette = "heat.colors", ymin = 0, ymax = 0, cex = 1,join = TRUE,pch = 15, main = "",sub = "",offset = TRUE,centered = FALSE, xrotate = FALSE, xaxs = "r", new = TRUE, legend = TRUE) spider(rock=WR, chondrit = selectNorm(), ymin = 0, ymax = 0, cex = NULL, plot = TRUE, join = TRUE, field = FALSE, legend = FALSE, add = FALSE, pch = NULL, col = NULL, shaded.col = "gray", density = 0.02, angle = 0, main = "", sub = "", offset = FALSE, centered = FALSE, xrotate = FALSE, xaxs = "r", fill.col = TRUE, log = "y", new = TRUE, ...)
new |
logical; if true, new plotting window is opened. |
chondrit |
a numeric matrix with one row; the normalizing values. |
what |
variable name or formula. |
colour.palette |
variable name or formula. |
rock |
a numeric matrix; the whole-rock data from which will be filtered out those to be normalized. |
ymin, ymax |
y range of the diagram. |
cex |
magnification of the plotting symbols. |
plot |
logical; if set to FALSE, individual patterns are not plotted. |
join |
logical; if TRUE, the NAs are extrapolated so that the patterns are unbroken. |
field |
logical; if TRUE, a shaded field denoting the overall data span is plotted |
legend |
logical; if TRUE, room for legend is reserved. |
add |
logical; if FALSE, a new plot is started (otherwise overplot). |
pch |
a vector specifying the plotting symbols. |
col |
a numeric vector; colour of the plotting symbols and connecting lines. |
fill.col |
logical; should be the field of overall variability filled by solid colour? |
shaded.col |
numeric: colour for the cross-hatched or solid fill. |
density |
numeric: density of the fill pattern (fraction of the whole plotting range). |
angle |
numeric: angle of the fill pattern (in degrees). |
main |
character: the main title for the plot. |
sub |
character: the subtitle for the plot. |
xrotate |
logical; shall be the element names on x axis rotated? |
offset |
logical; shall be the names for odd and even elements shifted relative to each other? |
centered |
logical; shall be the element names on x axis plotted in between tick marks? |
xaxs |
style of the xaxis: see ' |
log |
which of the axes should be logarithmic? |
... |
further graphical parameters: see ' |
This is a quite flexible function, a true Mother of All Spiderplots, that
can be used in a number of ways. It is employed by functions of the GCDkit system
for normalization and plotting individual patterns for selected samples
('spiderplot.r
') or each of the groups
('spider by group individual.r
'). In 'spiderplot.r
' is stored a
user interface to 'spider
' for
plotting individual patterns.
Function 'spider
' can also serve for plotting the overall compositional ranges
(shown as cross-hatched fields or, optionally, semitransparent filled polygons)
in a manner similar to function
'spider by group.r
'.
In 'spiderplot_contour.r
' is stored a user interface to 'spider
' for
plotting individual patterns, in which the plotting symbols is uniform and colour
reflects distribution of an independent variable, such as silica contents.
The variable (or formula) can be specified using the parameter 'what
', the
colour scheme by 'colour.palette
'. The legal colour schemes are:
'"grays","reds","blues"
,
"greens","cyans","violets","yellows","cm.colors","heat.colors","terrain.colors"
,
"topo.colors","rainbow", "jet.colors"
'.
The samples to be plotted can be selected based on combination of three
searching mechanisms (by sample name/label, range or a Boolean condition) - see
selectSamples
for details.
For choosing the correct normalization values serves the auxiliary function
selectNorm
.
Then the user is prompted whether to use the currently assigned plotting symbols.
If desired so, the symbols and colours can be specified in a simple spreadsheet-
like interface.
Likewise the scale of the y axis can be specified.
The exact appearance of the labels to the x axis can be fine tuned by the arguments
'rotate.xlab
', 'offset
' and 'centered
'. See examples.
If 'plot=FALSE
', not plotting is done, and only the normalized
values are returned.
results |
numeric matrix with normalized concentrations. |
If not specified, the parameters pch
, col
and cex
are set up by default to 0 (circle),
black and 1 numeric matrix, respectively.
The only exception occurs when the plotting object is WR
, when the missing
plotting parameters are sought in the dataframe labels
, i.e. among the standard plotting properties.
Vojtěch Janoušek, vojtech.janousek@geology.cz;
Vojtěch Erban, erban@sopky.cz, contributed the algorithm hatching closed polygons
For the syntax of the setup file with normalizing values and adding new
normalization schemes
see selectNorm
; for further applications of
'spider
' see spider2norm
,
spiderByGroupPatterns
and spiderByGroupFields
.
data(blatna) accessVar("blatna") ee<-spider.contour("Boynton","SiO2","reds",pch="*",cex=1.5,ymin=0.01,ymax=1000) # ee<- redirects the output spider(WR,"Boynton",0.1,1000,pch="*",col="red",cex=2,join=FALSE) spider(WR[1:11,],"Boynton",1,500,pch=1:11,col=1:11,legend=TRUE) spider(WR,"Boynton",field=TRUE,density=0.02,angle=60,col="darkred",fill.col=FALSE,0.1,1000) spider(WR,"Boynton",field=TRUE,fill.col=TRUE,shaded.col="khaki",0.1,1000) # Shade the background field portraying the overall variation spider(WR,"Boynton",0.1,1000) spider(WR,"Boynton",field=TRUE,fill.col=TRUE,shaded.col="gray",add=TRUE) spider(WR,"Boynton",0.1,1000) spider(WR,"Boynton",field=TRUE,density=0.02,angle=45,col="gray",fill.col=FALSE,add=TRUE) # Custom normalization scheme chon<-c(0.4,4,50,0.8,0.7,10,35,9,340,9,70,8.0) chon<-matrix(chon,nrow=1) colnames(chon)<-c("K2O","Rb","Ba","Th","Ta","Nb","Ce","Hf","Zr","Sm","Y","Yb") rownames(chon)<-"ORG (Pearce et al. 1984)" spider(WR,chon,ymin=0.01,col="navy",ymax=1000) # Possible styles for x axis multiplePerPage(8,nrow=2,ncol=4,"Possible x axis styles", dummy=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=FALSE, xrotate=FALSE, centered=FALSE, main="offset=FALSE, xrotate=FALSE, centered=FALSE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=FALSE, xrotate=TRUE, centered=FALSE, main="offset=FALSE, xrotate=TRUE, centered=FALSE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=FALSE, xrotate=FALSE, centered=TRUE, main="offset=FALSE, xrotate=FALSE, centered=TRUE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=FALSE, xrotate=TRUE, centered=TRUE, main="offset=FALSE, xrotate=TRUE, centered=TRUE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=TRUE, xrotate=FALSE, centered=FALSE, main="offset=TRUE, xrotate=FALSE, centered=FALSE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=TRUE, xrotate=TRUE, centered=FALSE, main="offset=TRUE, xrotate=TRUE, centered=FALSE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=TRUE, xrotate=FALSE, centered=TRUE, main="offset=TRUE, xrotate=FALSE, centered=TRUE",new=FALSE) spider(WR, "Boynton", 0.1, 1000, offset=TRUE, xrotate=TRUE, centered=TRUE, main="offset=TRUE, xrotate=TRUE, centered=TRUE",new=FALSE) plateCexLab(1.5) plateRedraw() spider(WR,"Boynton",plot=FALSE) # Calculation only print(results)