Skip to content

Commit

Permalink
Merge pull request #46 from MindTheGap-ERC/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
NiklasHohmann authored Sep 27, 2024
2 parents 9ef4b94 + 8c79115 commit da086a9
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
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.1.9000
Version: 0.3.1.9001
Authors@R:
person("Niklas", "Hohmann", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1559-1838"))
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ S3method(set_T_unit,sac)
S3method(strat_to_time,list)
S3method(strat_to_time,numeric)
S3method(strat_to_time,phylo)
S3method(strat_to_time,pre_paleoTS)
S3method(summary,adm)
S3method(summary,multiadm)
S3method(summary,sac)
S3method(time_to_strat,list)
S3method(time_to_strat,numeric)
S3method(time_to_strat,phylo)
S3method(time_to_strat,pre_paleoTS)
export(L_axis_lab)
export(T_axis_lab)
export(add_adm_to_multiadm)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# admtools (development version)

* added transformations for S3 class `pre_paleoTS` to integrate with `StratPal` and `paleoTS` package

* added anchoring of age-depth models via `anchor`

# admtools 0.3.1
Expand Down
7 changes: 7 additions & 0 deletions R/is_adm.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ is_adm = function(x, quietly = TRUE){
#'
#' @returns logical. Is the input a valid adm object?
#'
#'
#' @examples
#'
#' x = tp_to_adm(t = c(2,1), h = c(1,2)) # reversed order of time tie points
#' is_adm(x) # returns FALSE
#'
#'


warning_status = getOption("warn")
Expand Down
20 changes: 20 additions & 0 deletions R/strat_to_time.pre_paleoTS.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
strat_to_time.pre_paleoTS = function(obj, x, ...){
#' @export
#'

li = obj
adm = x

if (! "h" %in% names(li)){
stop("no stratigraphic information found. Expected element with name \"h\" in list")
}
if ("t" %in% names(li)){
warning("Found element with name \"t\" in list. Temporal information will be overwritten")
}

li[["t"]] = get_time(adm, h = li[["h"]], ...)
li = li[names(li) != "h" ]
class(li) = c("pre_paleoTS" ,"timelist", "list")
return(li)

}
18 changes: 18 additions & 0 deletions R/time_to_strat.pre_paleoTS.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
time_to_strat.pre_paleoTS = function(obj, x, ...){
#' @export

li = obj
adm = x

if (! "t" %in% names(li)){
stop("no time information found. Expected element with name \"t\"")
}
if ("h" %in% names(li)){
warning("Found element with name \"h\" in list. Height information will be overwritten")
}

li[["h"]] = get_height(adm, t = li[["t"]], ...)
li = li[names(li) != "t" ]
class(li) = c("pre_paleoTS" , "stratlist", "list")
return(li)
}
7 changes: 7 additions & 0 deletions man/is_adm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit da086a9

Please sign in to comment.