Learn R Programming

⚠️There's a newer version (0.4.6) of this package.Take me there.

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

607

Version

0.4.5

License

GPL (>= 3)

Maintainer

Tobias Stephan

Last Published

February 26th, 2025

Functions in tectonicr (0.4.5)

PoR2Geo_azimuth

Azimuth Conversion From PoR to Geographical Coordinate Reference System
PositionCenterSpoke

Centrically aligned geom_spoke marker
PoR_stress2grid

Spatial Interpolation of SHmax in PoR Coordinate Reference System
circular_mode

Circular Mode
PoR_azi

Azimuth Conversion from Geographical to PoR Coordinate Reference System
circle_stats

Summary Statistics of Circular Data
circular_dispersion_boot

Bootstrapped Estimates for Circular Dispersion
coordinates2

Coordinate Transformations
coordinate_mod

Coordinate Correction
circular_summary

Circular Summary Statistics
axes

Plot axes
PoR_coordinates

Coordinates of the Pole of Rotation Reference System
circular_sd_error

Standard Error of Mean Direction of Circular Data
cpm_models

Global model of current plate motions
circular_plot

Circular plot
Q4_to_euler

Euler angle/axis from quaternion
circular_qqplot

Quantile-Quantile Linearised Plot for Circular Distributions
distance_binned_stats

Distance Binned Summary Statistics
distance_from_pb

Distance from plate boundary
circular_range

Circular Range
angle-conversion

Degrees to Radians
angle_vectors

Angle Between Two Vectors
PoR_crs

PoR coordinate reference system
earth_radius

Earth's radius in km
euler_to_Q4

Quaternion from Euler angle-axis representation for rotations
coordinates

Coordinate Transformations
confidence_interval_fisher

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

Equivalent rotation
get_distance

Helper function to Distance from plate boundary
kuiper_test

Kuiper Test of Circular Uniformity
deviation_norm

Normalize Angle Between Two Directions
deviation_shmax

Deviation of Observed and Predicted Directions of Maximum Horizontal Stress
norm_chisq

Normalized Chi-Squared Test for Circular Data
import_WSM2016

World Stress Map Database (WSM) Release 2016
get_projected_pb_strike

Helper function to get Distance from plate boundary
get_relrot

Helper function to Equivalent rotation
conjugate_Q4

Conjugation of a Quaternion
kernel_dispersion

Adaptive Kernel Dispersion
dispersion

Circular Distance and Dispersion
relative_rotation

Relative rotation between two rotations
parse_wsm

Numerical values to World Stress Map Quality Ranking
rayleigh_test

Rayleigh Test of Circular Uniformity
pb2002

Global model of current plate motions
rotate_lines

Rotate Lines
normalize_Q4

Quaternion normalization
rose_stats

Show Average Direction and Spread in Rose Diagram
circle_mean_diff

Circular Mean Difference
por_transformation_df

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

library(tectonicr)
get_azimuth

Azimuth Between two Points
dist_greatcircle

Distance between points
projected_pb_strike

Strike of the plate boundary projected on data point
compact-grid

Compact Smoothed Stress Field
por_transformation_quat

Conversion between PoR to geographical coordinate system using quaternions
euler_pole

Euler pole object
product_Q4

Product of quaternions
roll_circstats

Apply Rolling Functions using Circular Statistics
est.kappa

Concentration parameter of von Mises distribution
spec_atan

Quadrant-specific inverse of the tangent
second_central_moment

Second Central Momentum
distance_mod

Normalize angular distance on a sphere distance
confidence

Confidence Interval around the Mean Direction of Circular Data
tectonicr.colors

Colors for input variables
rose_bw

Selecting optimal number of bins and width for rose diagrams
stress_paths

Theoretical Plate Tectonic Stress Paths
stress_data

Example crustal stress dataset
superimposed_shmax

SHmax direction resulting from multiple plate boundaries
line_azimuth

Extract azimuths of line segments
rolling_test

Apply Rolling Functions using Circular Statistical Tests for Uniformity
rose_geom

Direction Lines and Fans in Circular Diagram
nuvel1_plates

Plate Boundaries on the Earth
plates

Plate Boundaries on the Earth
nuvel1

NUVEL-1 Global model of current plate motions
dummy

Plate Stress Dummy Grid
is.Q4

Check if object is quaternion
prd_err

Error of Model's Prediction
quick_plot

Plotting Stress Analysis Results
superimposed_shmax_PB

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

Circular Density Plot
is.euler

Check if object is euler.pole
rolling_test_dist

Apply Rolling Functions using Circular Statistics
por_transformation_sf

Conversion between PoR to geographical coordinates of sf data
mean_SC

Mean Cosine and Sine
mean_resultant_length

Mean Resultant Length
rose

Rose Diagram
plot_points

Add Points to a Circular Plot
raster_transformation

Conversion between PoR to geographical coordinate reference system of raster data
rotation_Q4

Rotation of a vector by a quaternion
model_shmax

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

Circular Sample Median and Deviation
por_transformation

Conversion between spherical PoR to geographical coordinate system
stress_colors

Color palette for stress regime
spherical_angle

Angle along great circle on spherical surface
stress2grid

Spatial Interpolation of SHmax
stress_analysis

Quick analysis of a stress data set
watson_test

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

Weighted Goodness-of-fit Test for Circular Data
vcross

Vector cross product
trigon

Trigonometric Functions in Degrees
vm_qqplot

von Mises Quantile-Quantile Plot
vonmises

The von Mises Distribution
abs_vel

Absolute Plate Velocity
PoR_map

Plot Data in PoR Map
PoR_distance

Distance to Pole of Rotation