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.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().
  • Azimuth plotting using geom_azimuth() or geom_azimuthpoint() in 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 with kernel_dispersion()
  • Download and filter world stress map data using download_WSM()

The {tectonicr} package is all about orientation data in 2D. For analyzing orientations in 3D (spherical statistics, equal-area projections, etc. ), check out the structr package!

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 ([email protected])

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

407

Version

0.4.10

License

GPL (>= 3)

Maintainer

Tobias Stephan

Last Published

November 3rd, 2026

Functions in tectonicr (0.4.10)

circular_range

Circular Range
circular_sd_error

Standard Error of Mean Direction of Circular Data
equivalent_rotation

Equivalent rotation
estimate-kappa

Concentration parameter of von Mises distribution
distance_mod

Normalize angular distance on a sphere distance
angle_vectors

Angle Between Two Vectors
compact-grid

Compact Smoothed Stress Field
geom_azimuth

Azimuth visualization
ar_test

Angular Randomisation Test of Homogeneity
confidence

Confidence Interval around the Mean Direction of Circular Data after Batschelet (1971)
confidence_interval_fisher

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

Deviation of Observed and Predicted Directions of Maximum Horizontal Stress
deviation_norm

Normalize Angle Between Two Directions
euler_pole

Euler pole object
circular_summary

Circular Summary Statistics
cunif

The Circular Uniform Distribution
earth_radius

Earth's radius in km
data2PoR

Transforms coordinates and azimuths into PoR coordinates system
dummy

Plate Stress Dummy Grid
equal_kappa_test

Equal \(\kappa\) Test
coordinate_mod

Coordinate Correction
homing

Homing directions of Pidgeons
import_WSM

World Stress Map Database (WSM)
mean_SC

Mean Cosine and Sine
cpm_models

Global model of current plate motions
norm_chisq

Normalized Chi-Squared Test for Circular Data
model_shmax

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

Strike of the plate boundary projected on data point
mean_resultant_length

Mean Resultant Length
distance_from_pb

Distance from plate boundary
coordinates

Coordinate Transformations
is.euler

Check if object is euler.pole
distance_binned_stats

Distance Binned Summary Statistics
dispersion

Circular Distance and Dispersion
get_distance

Helper function to Distance from plate boundary
kernel_dispersion

Adaptive Kernel Dispersion
get_projected_pb_strike

Helper function to get Distance from plate boundary
geom_azimuthpoint

Azimuth + point visualization
dist_greatcircle

Distance between points
get_azimuth

Azimuth Between two Points
kuiper_test

Kuiper Test of Circular Uniformity
ort-eigen

Decomposition of Orientation Tensor in 2D
quick_plot

Plotting Stress Analysis Results
plates

Plate Boundaries on the Earth
plot_density

Circular Kernel Density Plot
rose_stats

Show Average Direction and Spread in Rose Diagram
line_azimuth

Extract azimuths of line segments
nuvel1

NUVEL-1 Global model of current plate motions
rotate_lines

Rotate Lines
parse_wsm

Numerical values to World Stress Map Quality Ranking
pb2002

Global model of current plate motions
ortensor2d

Orientation Tensor
rose

Rose Diagram
por_transformation_sf

Conversion between PoR to geographical coordinates of sf data
por_transformation

Conversion between spherical PoR to geographical coordinate system
plot_points

Add Points to a Circular Plot
sample_median

Sample Circular Median and Deviation
sample_dispersion

Sample circular dispersion
rolling_test_dist

Apply Rolling Functions using Circular Statistics
second_central_moment

Second Central Momentum
rayleigh-test

Rayleigh Test of Circular Uniformity
shortest_distance_to_line

Shortest distance between pairs of geometries
relative_rotation

Relative rotation between two rotations
prd_err

Error of Model's Prediction
spec_atan

Quadrant-specific inverse of the tangent
tectonicr.colors

Colors for input variables
tectonicr

library(tectonicr)
stress_paths

Theoretical Plate Tectonic Stress Paths
watson_two_sample

Watson's Two-Sample Test of Homogeneity
watson_test

Watson's \(U^2\) Test for Goodness-of-Fit against known Distribution
nuvel1_plates

Plate Boundaries on the Earth
trigon

Trigonometric Functions in Degrees
uniform_scores_test

Uniform scores test
spherical_angle

Angle along great circle on spherical surface
weighting

Weighting Factors
which.nsmallest

Indices of n smallest values in array
stress2grid

Spatial Interpolation of SHmax
rose_geom

Direction Lines and Fans in Circular Diagram
wcauchy

The Wrapped Cauchy Distribution
striae

Glacial striae from Finland
por_transformation_df

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

Selecting optimal number of bins and width for rose diagrams
por_transformation_quat

Conversion between PoR to geographical coordinate system using quaternions
vcross

Vector cross product
vm_qqplot

von Mises Quantile-Quantile Plot
stress_analysis

Quick analysis of a stress data set
watson_williams_test

Watson-Williams Test of Homogeneity of Means
watson_wheeler_test_perm

Watson-Wheeler Test of Homogeneity
weighted-rayleigh-test

Weighted Goodness-of-fit Test for Circular Data
get_relrot

Helper function to Equivalent rotation
rao_spacing_test

Rao Spacing Test
hodges_ajne_test

Hodges-Ajne Test
raster_transformation

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

Color palette for stress regime
roll_circstats

Apply Rolling Functions using Circular Statistics
rolling_test

Apply Rolling Functions using Circular Statistical Tests for Uniformity
stress_data

Example crustal stress dataset
wnorm

The Wrapped Normal Distribution
walraff_test

Wallraff Test of Angular Distances
superimposed_shmax_PB

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

SHmax direction resulting from multiple plate boundaries
vonmises

The von Mises Distribution
PoR_stress2grid

Spatial Interpolation of SHmax in PoR Coordinate Reference System
PoR_coordinates

Coordinates of the Pole of Rotation Reference System
abs_vel

Absolute Plate Velocity
PoR_crs

PoR coordinate reference system
PoR_azi

Azimuth Conversion from Geographical to PoR Coordinate Reference System
PoR_map

Map of data in Pole of Rotation reference frame
PoR2Geo_azimuth

Azimuth Conversion From PoR to Geographical Coordinate Reference System
PositionCenterSpoke

Centrically aligned geom_spoke marker
PoR_distance

Distance to Pole of Rotation
angle-conversion

Degrees to Radians
circular_plot

Circular plot
axes

Plot axes
circle_stats

Summary Statistics of Circular Data
circular_qqplot

Quantile-Quantile Linearised Plot for Circular Distributions
circular_dispersion_boot

Bootstrapped Estimates for Circular Dispersion
circle_mean_diff

Circular Mean Difference
circular_density

Circular Kernel Density Estimation
circular_mode

Circular Mode
coordinates2

Coordinate Transformations