Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #33

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Dev #33

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$

^CONTRIBUTING.md$
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# contributing to this repository

Welcome, and thank you for contributing to this codebase! This document specifies contribution guidelines.

## Important links

- [Bug reporting](#reporting-bugs)
- [Request features or enhancements](#request-features-or-enhancements)
- [Improving documentation](#improving-documentation)
- [Contributing code and features](#contributing-code-and-features)

## Contribution guidelines

### Reporting bugs {#reporting-bugs}

Suspect or found a bug? To report it, use the GitHub issues [here](https://github.com/MindTheGap-ERC/admtools/issues), and tag your issue with the "bug" label. Please describe the bug in as much detail as you can, including (1) a description of the unexpected behavior you observed (2) what behavior you expected and (3) (if possible) a minimum running example. The more detailed your bug report is, the easier it is for us to fix, and the faster we will be able to fix it.

### Request features or enhancements

Do you think the codebase is lacking, could use a cool new feature, or should better integrate with existing codebases or packages? Then submit your feature/enhancement request in the [Github issues](https://github.com/MindTheGap-ERC/admtools/issues) using the "enhancement" label. Please describe in detail what the new feature should do, and how it should integrate with the existing codebase or other packages. We will review each enhancement request and decide on a case-by-case basis if we will implement it. Our decision is guided both by the usefulness of the request and available development time.

### Improving documentation

Do you think the documentation is lacking? We're always happy to improve! If you want to improve documentation, fork the repository, make your changes, and submit a pull request with the "documentation" label. We will include your improvements into the code base after a review.

### Contributing code and features

Would you like to contribute a new feature to the code base, or improve existing code? Then fork the repository, add your features, and submit a pull request using the "enhancement" label. We will decide on a case-by-case basis if the pull request is accepted or not. This will be discussed with all active authors and contributers to the code base. Criteria for inclusion of new code are code quality, clarity and utility of the features, and whether the new feature enhances the original idea of the code base. If you are unsure if your feature would fit into the codebase, please use GitHub issues to discuss your idea (using the "enhancement" label) so we can give you feedback.

While this is not a criterion for code inclusion, we strongly encourage that each new feature includes tests that ensure that the feature works as intended and integrates with the existing codebase seamlessly.

When you contribute new functionality please add it to the list of available functionality under `vignettes/admtools_doc.Rmd`

## Authors and contributors

For a list of authors and contributors please see the README file.
8 changes: 8 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ S3method(get_total_thickness,adm)
S3method(get_total_thickness,multiadm)
S3method(is_destructive,adm)
S3method(is_destructive,multiadm)
S3method(max_height,adm)
S3method(max_time,adm)
S3method(min_height,adm)
S3method(min_time,adm)
S3method(plot,adm)
S3method(plot,multiadm)
S3method(plot,sac)
Expand Down Expand Up @@ -79,10 +83,14 @@ export(is_adm)
export(is_destructive)
export(is_sac)
export(make_legend)
export(max_height)
export(max_time)
export(mean_adm)
export(median_adm)
export(merge_adm_to_multiadm)
export(merge_multiadm)
export(min_height)
export(min_time)
export(plot_condensation)
export(plot_erosive_intervals)
export(plot_sed_rate_l)
Expand Down
2 changes: 2 additions & 0 deletions R/get_total_duration.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ get_total_duration = function(x){
#'
#' @returns numeric vector, total duration covered by the age-depth models
#'
#' @seealso [min_time()] and [max_time()] to extract the first/last tie point in time
#'
UseMethod("get_total_duration")
}
2 changes: 2 additions & 0 deletions R/get_total_thickness.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ get_total_thickness = function(x){
#'
#' @returns numeric vector containing total sediment thickness accumulated
#'
#' @seealso [max_height()] and [min_height()] to extract the highest/lowest stratigraphic point
#'
UseMethod("get_total_thickness")
}
19 changes: 19 additions & 0 deletions R/max_heigth.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
max_height = function(x){
#' @export
#'
#' @title get highest stratigraphic position in an adm
#'
#' @param x an age-depth model
#'
#' @returns a scalar
#'
#' @seealso [min_height()], [get_total_thickness()]
#'
UseMethod("max_height")
}

max_height.adm = function(x){
#' @export

return(max(x$h))
}
19 changes: 19 additions & 0 deletions R/max_time.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
max_time = function(x){
#' @export
#'
#' @title extract earliest time from adm
#'
#' @param x age-depth model
#'
#' @returns a scalar, timing of earliest tie point in the adm
#'
#' @seealso [min_time()], [get_total_duration()]
#'
UseMethod("max_time")
}

max_time.adm = function(x){
#' @export
#'
return(max(x$t))
}
20 changes: 20 additions & 0 deletions R/min_height.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
min_height = function(x){

#' @export
#'
#' @title get lowest stratigraphic position in an adm
#'
#' @param x an age-depth model
#'
#' @seealso [get_total_thickness()], [max_height()]
#'
UseMethod("min_height")

}

min_height.adm = function(x){

#' @export

return(min(x$h))
}
19 changes: 19 additions & 0 deletions R/min_time.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
min_time = function(x){
#' @export
#'
#' @title extract last time from adm
#'
#' @param x age-depth model
#'
#' @returns a scalar, timing of last tie point in the adm
#'
#' @seealso [max_time()], [get_total_duration()]
#'
UseMethod("min_time")
}

min_time.adm = function(x){
#' @export
#'
return(min(x$t))
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ GPL-3.0, see LICENSE file for license text.

Copyright 2023 Netherlands eScience Center and Utrecht University

## Contribution

For contribution guidelines see the CONTRIBUTING.md file

## Citation

To cite the package, use
Expand Down
3 changes: 3 additions & 0 deletions man/get_total_duration.Rd

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

3 changes: 3 additions & 0 deletions man/get_total_thickness.Rd

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

20 changes: 20 additions & 0 deletions man/max_height.Rd

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

20 changes: 20 additions & 0 deletions man/max_time.Rd

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

17 changes: 17 additions & 0 deletions man/min_height.Rd

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

20 changes: 20 additions & 0 deletions man/min_time.Rd

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

4 changes: 4 additions & 0 deletions vignettes/admtools_doc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ The following functions extract information from `adm` objects:
- `is_destructive`
- `sed_rate_l` and `sed_rate_l_fun` to extract sedimentation rate in height domain
- `sed_rate_t` and `sed_rate_t_fun` to extract sedimentation rate in time domain
- `max_height.adm` extracts highest stratigraphic point in adm
- `min_height.adm` extracts lowest stratigaphic point in adm
- `min_time.adm` extracts timing of first tie point in adm
_ `max_time.adm` extracts timing of last tie point in adm

#### Transformation into other S3 classes

Expand Down
Loading