plateAddReservoirs {GCDkit}R Documentation

Plate editing: plateAddReservoirs

Description

This function enables adding selected data from typical geochemical reservoirs (e.g., Upper Continental Crust, MORB ...), ideal mineral compositions, results of petrogenetic modelling or just another dataset used for comparison to a plate of Figaro-compatible plots.

Usage

plateAddReservoirs(autoscale=FALSE, var.name=NULL, sample.names=NULL,
    reserv.condition=NULL, labs=NULL, pch="*", col="darkblue", cex=1, type="p",
    just.draw=FALSE,...)

Arguments

autoscale

logical; should be the scaling changed so that all the plotted data fit in?

var.name

text; either 'reservoirs.data', 'idealmins.data' or a name of a global variable. See Details.

sample.names

character vector; names of reservoirs, ideal minerals or samples to be plotted.

reserv.condition

text; regular expression specifying names of reservoirs, ideal minerals or samples to be plotted.

labs

text; optional labels for the individual reservoirs.

pch

plotting symbols.

col

plotting colours.

cex

numeric; relative size of the plotting symbols.

type

character; plot type; see plot.default.

just.draw

logical; if FALSE, the overplotted bit is added permanently, i.e. the Figaro template is also affected.

...

additional parameters to the plotting function. See figOverplot.

Details

The function 'plateAddReservoirs' overplots compositions of selected geochemical reservoirs (from the file 'reservoirs.data', see selectNorm for the file structure as well as relevant references) or ideal minerals (from the file 'idealmins.data') onto a current plate.

Alternatively, if the name of a numeric matrix or dataframe in the global environment is provided via the argument 'var.name', data from this object are used (see Examples). The selection of samples is governed either by 'sample.names' or by 'reserv.condition' parameters.

Optional argument 'labs' can provide alternative, perhaps abbreviated textual labels to the points plotted.

Please note that this function is so far available for spiderplots, binary and ternary plots only and no special indexes, e.g. for Debon and Le Fort's plots, are calculated.

By default, the overplotted information is added permanently but this behaviour is controlled by the argument just.draw.

Value

A list of numeric matrices with the overplotted analyses from the reference dataset.

Warning

If just.draw=FALSE, the points for the reference dataset do not become a part of the template, and thus will vanish upon redrawing, zooming .... See Examples.

Author(s)

Vojtěch Janoušek, vojtech.janousek@geology.cz

See Also

figAddReservoirs selectNorm overplotDataset figOverplot figOverplotDiagram

Examples

    data(blatna)
    accessVar("blatna")

    # Plate of simple binary and ternary plots    
    multiplePerPage(2,ncol=2,nrow=1,title="Testing plateAddReservoirs",dummy=FALSE)
    Plate(1)
    binary("Ba","Sr",new=FALSE,log="xy")
    Plate(2)
    plateExtract("Wood",1,main=" ")
    plateCex(2)
    plateCexLab(1.5)

    # Temporary overplotting with the selected reservoirs (just.draw=TRUE)
    # Sun & McDonough 1989 mantle reservoirs, Taylor & McLennan 1995 Upper/Lower Crust
    reserv<-c("(MORB|EMORB|OIB) McDonough","Upper Crust Taylor 1995","Lower Crust Taylor 1995") 
    reserv.names<-c("NMORB","EMORB","OIB","UCC","LCC") 
    plateAddReservoirs(TRUE,"reservoirs.data",reserv.condition=reserv,
        labs=reserv.names,cex=1.2,col="darkblue",just.draw=TRUE) 
        
    # Clearing
    plateRedraw()

    # Permanent overplotting with a modelled trend
    # Calculate Rayleigh-type fractionation trend and store in a global variable
    ff<-seq(1,0.1,-0.1) # F, amount of melt left
    x<-80*ff^(1.2-1)    # cL for three elements, arbitrary D of 1.2, 2.0 and 1.3
    y<-550*ff^(2.0-1)
    z<-1000*ff^(1.3-1)
    my.trend<-cbind(x,y,z)
    colnames(my.trend)<-c("Rb","Sr","Ba")
    rownames(my.trend)<-ff

    plateAddReservoirs(TRUE,var.name="my.trend",type="o",col="darkgreen",just.draw=FALSE)
    plateRedraw()

    # Plate of spider plots  
    ee<-spider(WR,"NMORB immobile",0.1,1000,pch=1:14,col=1:14,legend=TRUE)
    groupsByLabel("Suite")
    figMulti(nrow=1,ncol=3,plot.symb=TRUE)
    
    reserv<-c("OIB .* McDonough","Lower Crust Taylor 1995") 
    reserv.names<-c("OIB","LCC") 
     
    plateAddReservoirs(FALSE,"reservoirs.data",reserv.condition=reserv,
        labs=reserv.names,cex=2,col="darkgreen")

[Package GCDkit version 6.1 Index]