Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R Scatterplot Matrices and Correlograms — Geostatistical Analysis

R scripts for a geostatistical analysis of geomorphic, bathymetric and geological factors using scatterplot matrices (SPLOM / pairs plots) and correlograms. A scatterplot matrix lays out every pairwise scatterplot of a set of variables in a grid, revealing bivariate relationships, grouping and collinearity at a glance; correlograms summarise the same relationships as a matrix of correlation coefficients. The analysis distinguishes four tectonic plates (Pacific, Philippine, Mariana and Caroline) beneath the Mariana Trench.

Related publication

These scripts produced figures in:

Lemenkova, P. Scatterplot Matrices of the Geomorphic Structure of the Mariana Trench at Four Tectonic Plates (Pacific, Philippine, Mariana and Caroline): a Geostatistical Analysis by R. In: Problems of Tectonics of Continents and Oceans, 51st Tectonics Meeting, vol. 1, pp. 347-352. Lomonosov Moscow State University / Institute of Geology RAS, Moscow, 29 January - 2 February 2019.

Scripts

scatterplot_matrix_car.R

  • Reads a morphometric table (Morphology.csv) and removes incomplete records (na.omit with a per-row missing-value check).
  • Reshapes the four tectonic-plate columns (matched by the pattern "^plate") into a single "tectonics" variable keyed by a plate factor, using data.table::melt (setDT), and relabels the factor levels (Philippine, Pacific, Mariana, Caroline plates).
  • Draws grouped scatterplot matrices with car::scatterplotMatrix, conditioned by the plate factor (| variable), with per-group colours (ColorBrewer Set2), per-group plotting symbols and linear-regression lines (regLine = lm), for two variable sets (tectonics + slope angle + igneous volcanic zones; tectonics + minimal depth + sediment thickness).

scatterplot_matrix_ggally_correlograms.R

  • Builds generalized pairs plots (scatterplot correlation matrices) with GGally::ggpairs, customising the upper (density), lower (points / box / density-strip) and diagonal (density) panels, including a version grouped by a slope-angle class factor.
  • Computes and visualises correlations with GGally::ggcorr under three methods: Pearson (parametric), Spearman (non-parametric rank, circle geometry) and Kendall (rank, complete observations, text geometry).
  • Combines the Pearson and Spearman correlograms into a two-panel figure with cowplot::plot_grid.

Methods and algorithms

  • Scatterplot matrix (SPLOM / pairs plot) construction, grouped/conditioned by a categorical factor.
  • Linear-regression overlays within pairwise panels (least-squares fit).
  • Generalized pairs plots with mixed panel types (GGally ggpairs).
  • Correlation estimation by Pearson (parametric), Spearman and Kendall (non-parametric rank) methods, shown as correlograms (GGally ggcorr).
  • Wide-to-long reshaping with data.table::melt for grouped plotting.
  • Multi-panel figure composition (cowplot).

Data

  • Morphology.csv, GeoMorphology.csv, Morph-9-factors.csv: morphometric, bathymetric and geological factors sampled across the Mariana Trench, with per-observation tectonic-plate and slope-class attributes.

Requirements

  • R (>= 3.5)
  • Packages: car, GGally, ggplot2, data.table, cowplot, RColorBrewer

Install with:

install.packages(c("car", "GGally", "ggplot2", "data.table", "cowplot", "RColorBrewer"))

Usage

Place the required CSV in the working directory and run, e.g.:

Rscript scatterplot_matrix_car.R

Author and citation

Polina Lemenkova ORCID: https://orcid.org/0000-0002-5759-1089

If you use these scripts, please cite:

Lemenkova, P. Scatterplot Matrices of the Geomorphic Structure of the Mariana Trench at Four Tectonic Plates (Pacific, Philippine, Mariana and Caroline): a Geostatistical Analysis by R. In: Problems of Tectonics of Continents and Oceans, 51st Tectonics Meeting, vol. 1, pp. 347-352, Moscow, 2019. https://doi.org/10.6084/m9.figshare.7699787

License

See the LICENSE file in this repository.

About

R scripts for scatterplot-matrix (SPLOM) and correlogram geostatistical analysis of geomorphic factors: car::scatterplotMatrix grouped by tectonic plate with regression overlays, GGally ggpairs pairs plots, and ggcorr Pearson/Spearman/Kendall correlograms. Mariana Trench; Lemenkova (2019), 51st Tectonics Meeting, Moscow.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages