Skip to content

Commit e646e14

Browse files
committed
bug fixes
1 parent d5fbfc7 commit e646e14

6 files changed

Lines changed: 20 additions & 10 deletions

File tree

R/stress_inversion.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#' @examples
5858
#' set.seed(20250411)
5959
#' # Use Angelier examples
60-
#' par(mfrow = c(1, length(angelier1990)))
60+
#' par(mfrow = c(1, length(angelier1990)), mar = c(4, 1, 4, 1))
6161
#' invisible(lapply(angelier1990, function(x) {
6262
#' # Inversion after Michael (1984)
6363
#' res_michael <- slip_inversion(x, method = "michael", n_iter = 100, n = 100, res = 100)
@@ -82,11 +82,13 @@
8282
#' pch = 1,
8383
#' legend = c("Michael (1984)", "Angelier (1990)", "Yamaji & Sato (2006)",
8484
#' "Hansen (2013)", "WISSI"),
85-
#' col = 2:6
85+
#' col = 2:6, cex = 0.8
8686
#' )
87-
#' legend("bottomright",
87+
#' legend("bottom",
8888
#' pch = 1:3,
89-
#' legend = c("S1", "S2", "S3")
89+
#' legend = c("S1", "S2", "S3"),
90+
#' horiz = TRUE,
91+
#' cex = 0.8
9092
#' )
9193
#' }))
9294
slip_inversion <- function(x, method = c("michael", "angelier", "hansen", "yamaji", "wissi"), ...) {

R/stress_inversion_hansen.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ slip_inversion_hansen <- function(x, flip = FALSE, type = c("9d", "6d")) {
310310
# Theoretically resolved shear stress on plane
311311
sigma_s_mean <- mean(abs(shear_stress(val_Ts[1], val_Ts[3], theta)))
312312

313-
SHmax <- SH(p$principal_axes[1, ], p$principal_axes[2, ], p$principal_axes[3, ], R = stress_shape$R)
313+
SHmax <- SH(principal_axes[1, ], principal_axes[2, ], principal_axes[3, ], R = stress_shape$R)
314314

315315
# shearnorm <- tau2shearnorm(Ts, x, friction = friction)
316316
# tendency <- tau2tendency(Ts, x, friction = friction)

R/stress_inversion_yamaji.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ yamaji_sato <- function(normals, slips, wt) {
171171
#' @seealso [slip_inversion_yamaji_sato_boot()]
172172
#'
173173
#' @examples
174+
#' set.seed(20250411)
174175
#' nx <- length(angelier1990)
175176
#' par(mfrow = c(1, nx))
176177
#'
@@ -266,7 +267,7 @@ slip_inversion_yamaji_sato <- function(x, weights = NULL, flip = FALSE) {
266267

267268
# sigma_s_mean <- mean(abs(shearnorm))
268269

269-
SHmax <- SH(p$principal_axes[1, ], p$principal_axes[2, ], p$principal_axes[3, ], R = stress_shape$R)
270+
SHmax <- SH(p$principal_axes[1, ], p$principal_axes[2, ], p$principal_axes[3, ], R = shape$R)
270271

271272
# shearnorm <- tau2shearnorm(TR, x, friction = friction)
272273
# tendency <- tau2tendency(TR, x, friction = friction)

man/slip_inversion.Rd

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/slip_inversion_yamaji_sato.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/Fault_offsets.Rmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ set.seed(20250411)
2323
```
2424

2525

26+
```{r load_functions, include=FALSE}
27+
library("structr")
28+
```
29+
2630
The offset along a fault can be factorized into several components.
2731

2832
![Fig. 1: Graphic illustration of displacement components along a fault.

0 commit comments

Comments
 (0)