Learn R Programming

tectonicr

tectonicr is a free and open-source R package for modeling and analyzing the direction of the maximum horizontal stress (SHmax) based on the empirical link between the direction of intraplate stress and the direction of the relative motion of neighboring plates (Wdowinski, 1998; Stephan et al., 2023). The following methods are available:

  • Direction of the plate boundary forces: PoR_shmax() gives the predicted stress field adjacent to a plate boundary, calculated using the relative plate motion of the neighboring plates using the function model_shmax(). The goodness-of-fit can be statistically tested by e.g. norm_chisq(), circular_dispersion() ,rayleigh_test(), and confidence_interval().
  • Distance to plate boundary: distance_from_pb() gives the distance between the stress data point and the plate boundary measured along the stress trajectories.
  • Trajectories of the theoretical stress field eulerpole_paths() generates an sf object containing spatial information that is suitable to plot with, for instance, ggplot().
  • Relative rotations from a given set of plate motion parameters: equivalent_rotation() transfers a set of plate motion parameters into the relative plate motions among the given plates.
  • Average direction and variance of a set of SHmax data using (weighted) statistics and other parameters to statistically estimate the distribution parameters of pi-directional data.
  • Spatial interpolation of of SHmax: PoR_stress2grid() uses distance, method, and quality-weighted mean direction of stress data without being affected by angular distortions.
  • Rose plot rose() shows the frequencies of the orientations in polar coordinates
  • Stress anomaly map: spatial distribution of the dispersion of the observed stress field from the directions of plate boundary forces
  • Download and filter world stress map data using download_WSM2016()

Prerequisites

You must have R installed on your system (see https://www.r-project.org/). To install tectonicr from CRAN, type the following code at the R command line prompt:

install.packages("tectonicr")

Installation

The most recent development version of tectonicr is available from Github and can be installed on your system as follows:

# install.packages("remotes") # install if needed
remotes::install_github('tobiste/tectonicr')
library('tectonicr')

Using the stress measurements from the San Andreas Fault - Gulf of California example, a quick analysis and test against the right-lateral transform plate boundary can be achieved by:

# load example data
data(san_andreas)
data(nuvel1)
data(plates)

stress_analysis(
san_andreas, 
PoR = equivalent_rotation(nuvel1, "na", "pa"), 
type = "right", 
pb = subset(plates, pair == "na-pa")
)

The code produces the underlying results for Fig. 7 from Stephan et al. (2023)

Documentation

The detailed documentation can be found at https://tobiste.github.io/tectonicr/articles/A_tectonicr.html

GUI

There is a graphical user interface that provides some (limited) tectonicr functionalities. No need to install, just click on the link and you can run tectonicr on your browser:

https://tobiste.shinyapps.io/tectonicr-app/

Author

Tobias Stephan (tstephan@lakeheadu.ca)

Feedback, issues, and contributions

I welcome feedback, suggestions, issues, and contributions! If you have found a bug, please file it here with minimal code to reproduce the issue.

How to cite tectonicr

When referencing this package, please cite

Stephan, T., Enkelmann, E., and Kroner, U. (2023). Analyzing the horizontal orientation of the crustal stress adjacent to plate boundaries. Scientific Reports, 13(1). DOI: 10.1038/s41598-023-42433-2.

and the package DOI: 10.32614/CRAN.package.tectonicr.

License

GPL-3.0 License

Copy Link

Version

Install

install.packages('tectonicr')

Monthly Downloads

383

Version

0.4.6

License

GPL (>= 3)

Maintainer

Tobias Stephan

Last Published

March 1st, 2025

Functions in tectonicr (0.4.6)

circular_mode

Circular Mode
circular_plot

Circular plot
conjugate_Q4

Conjugation of a Quaternion
circular_dispersion_boot

Bootstrapped Estimates for Circular Dispersion
confidence_interval_fisher

Confidence Interval around the Mean Direction of Circular Data after Fisher (1993)
circular_sd_error

Standard Error of Mean Direction of Circular Data
circular_summary

Circular Summary Statistics
coordinates

Coordinate Transformations
coordinate_mod

Coordinate Correction
distance_mod

Normalize angular distance on a sphere distance
coordinates2

Coordinate Transformations
angle_vectors

Angle Between Two Vectors
dummy

Plate Stress Dummy Grid
cpm_models

Global model of current plate motions
is.euler

Check if object is euler.pole
earth_radius

Earth's radius in km
equivalent_rotation

Equivalent rotation
compact-grid

Compact Smoothed Stress Field
get_distance

Helper function to Distance from plate boundary
confidence

Confidence Interval around the Mean Direction of Circular Data
deviation_norm

Normalize Angle Between Two Directions
is.Q4

Check if object is quaternion
dispersion

Circular Distance and Dispersion
dist_greatcircle

Distance between points
est.kappa

Concentration parameter of von Mises distribution
get_projected_pb_strike

Helper function to get Distance from plate boundary
deviation_shmax

Deviation of Observed and Predicted Directions of Maximum Horizontal Stress
line_azimuth

Extract azimuths of line segments
euler_pole

Euler pole object
kernel_dispersion

Adaptive Kernel Dispersion
get_relrot

Helper function to Equivalent rotation
kuiper_test

Kuiper Test of Circular Uniformity
import_WSM2016

World Stress Map Database (WSM) Release 2016
nuvel1

NUVEL-1 Global model of current plate motions
plot_points

Add Points to a Circular Plot
nuvel1_plates

Plate Boundaries on the Earth
por_transformation_df

Conversion between spherical PoR to geographical coordinate system of data.frames
por_transformation_quat

Conversion between PoR to geographical coordinate system using quaternions
por_transformation

Conversion between spherical PoR to geographical coordinate system
mean_SC

Mean Cosine and Sine
rayleigh_test

Rayleigh Test of Circular Uniformity
norm_chisq

Normalized Chi-Squared Test for Circular Data
plates

Plate Boundaries on the Earth
relative_rotation

Relative rotation between two rotations
plot_density

Circular Density Plot
parse_wsm

Numerical values to World Stress Map Quality Ranking
prd_err

Error of Model's Prediction
por_transformation_sf

Conversion between PoR to geographical coordinates of sf data
product_Q4

Product of quaternions
pb2002

Global model of current plate motions
normalize_Q4

Quaternion normalization
projected_pb_strike

Strike of the plate boundary projected on data point
second_central_moment

Second Central Momentum
rose

Rose Diagram
rolling_test_dist

Apply Rolling Functions using Circular Statistics
distance_from_pb

Distance from plate boundary
distance_binned_stats

Distance Binned Summary Statistics
quick_plot

Plotting Stress Analysis Results
rotation_Q4

Rotation of a vector by a quaternion
sample_median

Circular Sample Median and Deviation
roll_circstats

Apply Rolling Functions using Circular Statistics
model_shmax

Theoretical Direction of Maximum Horizontal Stress in the geographical reference system.
rose_stats

Show Average Direction and Spread in Rose Diagram
rotate_lines

Rotate Lines
get_azimuth

Azimuth Between two Points
mean_resultant_length

Mean Resultant Length
euler_to_Q4

Quaternion from Euler angle-axis representation for rotations
rolling_test

Apply Rolling Functions using Circular Statistical Tests for Uniformity
vcross

Vector cross product
spherical_angle

Angle along great circle on spherical surface
trigon

Trigonometric Functions in Degrees
stress_colors

Color palette for stress regime
stress_analysis

Quick analysis of a stress data set
rose_geom

Direction Lines and Fans in Circular Diagram
raster_transformation

Conversion between PoR to geographical coordinate reference system of raster data
tectonicr.colors

Colors for input variables
stress2grid

Spatial Interpolation of SHmax
watson_test

Watson's \(U^2\) Test of Circular Uniformity
weighted_rayleigh

Weighted Goodness-of-fit Test for Circular Data
tectonicr

library(tectonicr)
rose_bw

Selecting optimal number of bins and width for rose diagrams
superimposed_shmax

SHmax direction resulting from multiple plate boundaries
superimposed_shmax_PB

SHmax direction resulting from multiple plate boundaries considering distance to plate boundaries
spec_atan

Quadrant-specific inverse of the tangent
stress_data

Example crustal stress dataset
stress_paths

Theoretical Plate Tectonic Stress Paths
vm_qqplot

von Mises Quantile-Quantile Plot
vonmises

The von Mises Distribution
PoR_distance

Distance to Pole of Rotation
PoR_map

Map of data in Pole of Rotation reference frame
PoR_stress2grid

Spatial Interpolation of SHmax in PoR Coordinate Reference System
PoR_azi

Azimuth Conversion from Geographical to PoR Coordinate Reference System
PoR_coordinates

Coordinates of the Pole of Rotation Reference System
PoR2Geo_azimuth

Azimuth Conversion From PoR to Geographical Coordinate Reference System
Q4_to_euler

Euler angle/axis from quaternion
abs_vel

Absolute Plate Velocity
PoR_crs

PoR coordinate reference system
angle-conversion

Degrees to Radians
circular_range

Circular Range
circular_qqplot

Quantile-Quantile Linearised Plot for Circular Distributions
circle_mean_diff

Circular Mean Difference
axes

Plot axes
circle_stats

Summary Statistics of Circular Data
PositionCenterSpoke

Centrically aligned geom_spoke marker