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.
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.
- DOI (figshare): https://doi.org/10.6084/m9.figshare.7699787
- Presentation slides (LaTeX/Beamer): https://github.com/paulinelemenkova/mariana-trench-scatterplot-analysis-slides
- 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).
- 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.
- 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).
- 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.
- R (>= 3.5)
- Packages: car, GGally, ggplot2, data.table, cowplot, RColorBrewer
Install with:
install.packages(c("car", "GGally", "ggplot2", "data.table", "cowplot", "RColorBrewer"))
Place the required CSV in the working directory and run, e.g.:
Rscript scatterplot_matrix_car.R
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
See the LICENSE file in this repository.