Learn R Programming

rgr (version 1.1.15)

gx.symm.coords.plot: Display a X-Y Plot, Scatterplot, of Symmetric Balances

Description

Displays a scatterplot based on symmetric balances for two parts, v1 and v2, from a n by p matrix or data frame of compositional data, and their correlation coefficient by the selected method, default spearman. Optionally the display in Garrett et al. (2017) may be generated, in which case the correlation coefficients estimated by any valid R method, by default "spearman" are displayed above the plots. By default the parts are displayed, left plot, with log-scaling. To plot without log-scaling, set log = FALSE, in which case the correlation coefficient is estimated without a logarithmic transformation. If "pearson" coefficients are required the option of a log transformation for the data is provided.

Usage

gx.symm.coords.plot(x, v1, v2, log = TRUE, method = "spearman", example = " ", ... )

Arguments

x

n by p matrix or data frame of compositional data for which a scatterplot will be displayed for two parts.

v1

the column index for the part to be displayed on the x-axis.

v2

the column index for the part to be displayed on the y-axis.

log

to compute the non-symmetric balance coefficients with a logarithmic transformation, set log = TRUE.

method

the valid R method for computation of the correlation coefficient between the symmetric balances for v1 and v2, the default is "spearman".

example

to reproduce the display in Garrett et al. (2017) set example = "Explore" or "explore".

further arguments to be passed to methods concerning the plot.

References

Garrett, R.G., Reimann, C., Hron, K., Kynclova, P. and Filzmoser, P., 2017. Finally, a correlation coefficient that tells the geochemical truth. Explore - Assoc. Applied Geochemists Newsletter, 176:1-10.

Reimann, C., Filzmoser, P., Hron, K., Kynclova, P. and Garrett, R.G., 2017. Correlation Analysis for Compositional (Environmental) Data. Science of the Total Environment, 607-608:965-971.

See Also

gx.symm.coords, gx.symm.coords.r

Examples

Run this code
# NOT RUN {
## Make test data available
data(nockolds)

## Display symmetric balances scatterplot for variable 1, Si, and 2, Al, for the nockolds data
gx.symm.coords.plot(nockolds, 1, 2)

## Display the example from Garrett et al. (2017)
gx.symm.coords.plot(nockolds, 1, 2, example = "explore")

## Clean-up
rm(nockolds)
# }

Run the code above in your browser using DataLab