Skip to content

Commit

Permalink
Merge pull request #18 from MindTheGap-ERC/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
NiklasHohmann authored Jan 18, 2024
2 parents 2f3a611 + bc79853 commit 57744ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/print.adm.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ print.adm = function(x, ...){
#' @export
#' @noRd

cat("Age-depth model")
cat("age-depth model")
return(invisible())
}
18 changes: 9 additions & 9 deletions vignettes/admtools.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ vignette(package = "admtools")

## The adm and multiadm classes

The *admtools* package defines two main classes: `adm` and `multiadm`. The class `adm` represent a single age-depth model, from which information can be extracted (e.g. completeness, number of hiatuses, etc.) and that can be used to transform data between the stratigraphic domain and time domain. The `multiamd` class is a list of `adm` objects. `multiadm` objects are used to represent uncertainties of age-depth models.
The *admtools* package defines three main classes: `adm,` `sac` and `multiadm`. The class `adm` represent a single age-depth model, from which information can be extracted (e.g. completeness, number of hiatuses, etc.) and that can be used to transform data between the stratigraphic domain and time domain. The `multiamd` class is a list of `adm` objects. `multiadm` objects are used to represent uncertainties of age-depth models. Objects of type `sac` are sediment accumulation curves that can contain information on erosion, and can be turned into age-depth models.

## Conventions

In contrast to its name, the *admtools* package currently deals with time and height instead of age and depth. In this sense, the age-depth models are time-height models. Both time and height can be negative values. To handle ages, use time before the present. To handle depths, use height below a point of reference (e.g., the sediment surface).

## Example

This example explains the construction and application of `adm` objects. As example data we use outputs from CarboCAT Lite, a model of carbonate platform growth (Burgess 2013, 2023). This data is automatically loaded in the background by the package. To inspect it, you can load it into your workspace via
This example explains the construction and application of `adm` objects. As example data we use outputs from CarboCAT Lite, a model of carbonate platform growth (Burgess 2013, 2023). This data is automatically loaded in the background by the package. To get some info of the data use

```{r}
data("CarboCATLite_data")
```{r, eval=FALSE}
?CarboCATLite_data
```

### Defining age-depth models
Expand Down Expand Up @@ -139,7 +139,7 @@ If you want to inspect the insides of the object, use `str`:
str(my_adm)
```

You can manually manipulate the fields of the `adm` object by treating it like a list. I do not recommend doing so, as it might result in unexpected behavior.
You can manually manipulate the fields of the `adm` object by treating it like a list. I do not recommend doing so, as it might result in unexpected downstream behavior.

You can plot `adm` objects via the standard `plot` function. Here, I use the option to highlight hiatuses in red, and increase the linw width of the conservative ( = non-destructive) intervals.

Expand All @@ -158,7 +158,7 @@ Use the functions `get_total_duration`, `get_total_thickness`, `get_completeness

```{r}
get_total_duration(my_adm) #total time covered by the age-depth model
get_total_thickness(my_adm) # total thickness of section represented by the amd
get_total_thickness(my_adm) # total thickness of section represented by the adm
get_completeness(my_adm) # stratigraphic completeness as proportion
get_incompleteness(my_adm) # stratigraphic incompleteness (= 1- strat. incompleteness)
get_hiat_no(my_adm) # number of hiatuses
Expand Down Expand Up @@ -191,15 +191,15 @@ is_destructive(my_adm,

The functions `get_height` and `get_time` are the workhorses to transform data using age-depth models.

- `get_time` takes and adm object and vector of heights `h` (stratigraphic positions), and returns a vector of times
- `get_height` takes an adm object and vector of times and returns a vector of associated positions
- `get_time` takes and `adm` object and vector of heights `h` (stratigraphic positions), and returns a vector of times
- `get_height` takes an `adm` object and vector of times and returns a vector of associated positions

As example, say we want to know the time of deposition of the following stratigraphic positions:

```{r}
h = c(30,120) # stratigraphic positions
get_time(my_adm,
h = h)
h = h)
```

Conversely, to determine what parts of the section are deposited as a specific time, use
Expand Down

0 comments on commit 57744ea

Please sign in to comment.