pwlrmap: Compositional maps, pairwise logratios Matrix of maps showing...

View source: R/exploratools.R

pwlrmapR Documentation

Compositional maps, pairwise logratios Matrix of maps showing different combinations of components of a composition, in pairwise logratios

Description

Compositional maps, pairwise logratios Matrix of maps showing different combinations of components of a composition, in pairwise logratios

Usage

pwlrmap(
  loc,
  comp,
  colscale = rev(rainbow(10, start = 0, end = 4/6)),
  cexrange = c(0.1, 2),
  scale = rank,
  commonscale = FALSE,
  foregroundcolor = "black",
  closeplot = TRUE
)

Arguments

loc

matrix or data.frame of coordinates of the sample locations

comp

composition observed at every location, can be a matrix, a data.frame or of one of the classes compositions::acomp or compositions::aplus

colscale

set of colors to be used as colorscale (defauls to 10 colors between blue and red)

cexrange

symbol size min and max values (default to 0.1 to 2)

scale

function scaling the set of z-values of each map, defaults to rank

commonscale

logical, should all plots share a common z-scale? defaults to FALSE

foregroundcolor

color to be used for the border of the symbol

closeplot

logical, should the plot be left open (FALSE) for further changes, or be frozen (TRUE)? defaults to TRUE

Value

The function is primarily called for producing a matrix of (D,D) plots of the D-part compositional samples, where at each plot we represent a map whose symbols are colored and sized according to a z-scale controlled by a different logratio. For each plot, this is the logratio of the row variable by the column variable. However, in case that closeplot=FALSE, this function returns invisibly the graphical parameters that were active prior to calling this function. This allows the user to add further stuff to the plots (mostly, using par(mfg=c(i,j)) to plot on the diagram (i,j)), or manually freeze the plot (by wrapping the call to pwlrmap on a call to par).

Examples


data("Windarling")
coords = as.matrix(Windarling[,c("Easting","Northing")])
compo = Windarling[,c("Fe","Al2O3","SiO2", "Mn", "P")]
compo$Rest = 100-rowSums(compo)
compo = compositions::acomp(compo) 
# in quantiles (default, ranking controls color and size)
pwlrmap(coords, compo) 

# in logratios (I=identity)
pwlrmap(coords, compo, scale=I)
# in ratios (i.e., apply exp)
pwlrmap(coords, compo, scale=exp)  
# use only color, no change in symbol size
pwlrmap(coords, compo, cexrange=c(1,1)) 
# change all
pwlrmap(coords, compo, commonscale=TRUE, cexrange=c(1.2,1.2), 
                    colscale=rev(rainbow(40, start=0, end=4/6))) 


gmGeostats documentation built on April 18, 2023, 5:08 p.m.