-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from MindTheGap-ERC/dev
Dev
- Loading branch information
Showing
18 changed files
with
237 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: admtools | ||
Title: Estimate and Manipulate Age-Depth Models | ||
Version: 0.3.0 | ||
Version: 0.3.1 | ||
Authors@R: | ||
person("Niklas", "Hohmann", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-1559-1838")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
get_L_tp = function(x, ...){ | ||
#' @export | ||
#' | ||
#' @title get height/length tie point | ||
#' | ||
#' @param x age-depth model (adm) or sediment accumulation curve (sac) | ||
#' @param ... other options, currently not used | ||
#' | ||
#' @description | ||
#' extracts the height/length time points from an age-depth model or sediment accumulation curve | ||
#' | ||
#' @returns numeric vector of the time/length tie points | ||
#' | ||
#' @seealso [get_T_tp()] to extract time tie points | ||
#' | ||
UseMethod("get_L_tp") | ||
} | ||
|
||
get_L_tp.adm = function(x, ...){ | ||
#' @export | ||
#' | ||
return(x$h) | ||
} | ||
|
||
get_L_tp.sac = function(x, ...){ | ||
#' @export | ||
#' | ||
return(x$h) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
get_T_tp = function(x, ...){ | ||
#' @export | ||
#' | ||
#' @title extract time tie points | ||
#' | ||
#' @param x age-depth model (adm) or sediment accumulation curve (sac) | ||
#' @param ... other options, currently unused | ||
#' | ||
#' @description | ||
#' Extracts the time tie points from an age-depth model or sediment accumulation curve | ||
#' | ||
#' @returns a vector, containing the time tie points | ||
#' | ||
#' @seealso [get_L_tp()] to extract length/height tie points | ||
#' | ||
UseMethod("get_T_tp") | ||
} | ||
|
||
get_T_tp.adm = function(x, ...){ | ||
#' @export | ||
return(x$t) | ||
} | ||
|
||
get_T_tp.sac = function(x, ...){ | ||
#' @export | ||
return(x$t) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
test_that("correct heights are returned",{ | ||
h = 1:4 | ||
t = 1:4 | ||
adm = tp_to_adm(t, h) | ||
expect_equal(get_L_tp(adm), h) | ||
|
||
h = rev(h) | ||
sac = tp_to_sac(t, h) | ||
expect_equal(get_L_tp(sac), h) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
test_that("correct times are returned",{ | ||
h = 1:4 | ||
t = 1:4 | ||
adm = tp_to_adm(t, h) | ||
expect_equal(get_T_tp(adm), t) | ||
|
||
h = rev(h) | ||
sac = tp_to_sac(t, h) | ||
expect_equal(get_T_tp(sac), t) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## sedrate_from_matrix is a higher order function. The code below can be used to interactively debug it | ||
|
||
|
||
# ex=cycles(freqs=c(1/405.6795,1/130.719,1/123.839,1/98.86307,1/94.87666,1/23.62069, | ||
# 1/22.31868,1/19.06768,1/18.91979),end=4000,dt=5) | ||
# | ||
# # convert to meters with a linearly increasing sedimentation rate from 0.01 m/kyr to 0.03 m/kyr | ||
# ex=sedRamp(ex,srstart=0.01,srend=0.03) | ||
# | ||
# # interpolate to median sampling interval | ||
# ex=linterp(ex) | ||
# | ||
# # evaluate precession & eccentricity power, and precession modulations | ||
# res=eTimeOpt(ex,win=20,step=1,fit=1,output=1) | ||
# | ||
# aa = get_data_from_eTimeOpt(res, index = 3) | ||
# | ||
# f = sed_rate_from_matrix(aa$heights, aa$sed_rate, aa$results, rate = 0.1, mode = "poisson") | ||
# plot(aa$heights, f()(aa$heights), type = "l") | ||
# | ||
# | ||
# height = aa$heights | ||
# sedrate = aa$sed_rate | ||
# matrix = aa$results | ||
# rate = 1 | ||
# i = 1 | ||
# transform = identity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.