diff --git a/DESCRIPTION b/DESCRIPTION index df4a8d7..8314676 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: StratPal Title: Stratigraphic Paleobiology Modeling Pipelines -Version: 0.2.0.9001 +Version: 0.3.0 Authors@R: person("Niklas", "Hohmann", , "N.H.Hohmann@uu.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1559-1838")) diff --git a/NAMESPACE b/NAMESPACE index 27299eb..e9ada82 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ S3method(apply_niche,numeric) S3method(apply_niche,pre_paleoTS) S3method(apply_taphonomy,numeric) S3method(apply_taphonomy,pre_paleoTS) +S3method(plot,pre_paleoTS) S3method(reduce_to_paleoTS,pre_paleoTS) export(apply_niche) export(apply_taphonomy) diff --git a/NEWS.md b/NEWS.md index d7698de..ad4cc79 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# StratPal (development version) +# StratPal 0.3.0 + +* bug fix for `apply_niche` and `apply_taphonomy` for `pre_paleoTS` format + +* plotting for `pre_paleoTS` fixed # StratPal 0.2.0 diff --git a/R/plot.pre_paleoTS.R b/R/plot.pre_paleoTS.R new file mode 100644 index 0000000..bb43fd4 --- /dev/null +++ b/R/plot.pre_paleoTS.R @@ -0,0 +1,29 @@ +plot.pre_paleoTS = function(x, ...){ + #' @export + #' + #' @title plot pre-paleoTS objects + #' + #' @param x object + #' @param ... other arguments + #' + #' @seealso [reduce_to_paleoTS()] + #' + #' @description + #' This functions throws an error on purpose, as `pre_paleoTS` objects can not be plotted directly. To plot them, first use `reduce_to_paleoTS` and use `plot` on the results + #' + #' @examples + #' \dontrun{ + #' x = stasis_sl(1:4) + #' # throws error + #' plot(x) + #' library("paleoTS") + #' # correct way to plot pre-paleoTS objects + #' y = reduce_to_paleoTs(x) + #' plot(y) + #' # this plots via the procedures of the paleoTS package (which must be installed and loaded) + #' } + #' + + + stop("Can't plot `pre_paleoTS` objects. Convert to paleoTS format using `reduce_to_paleoTS` and plot result via the paleoTS package.") +} diff --git a/_pkgdown.yml b/_pkgdown.yml index 45e3141..ef9482f 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -44,6 +44,7 @@ reference: desc: Tools for linkage with the paleoTS package contents: - reduce_to_paleoTS + - plot.pre_paleoTS articles: - title: Articles diff --git a/man/plot.pre_paleoTS.Rd b/man/plot.pre_paleoTS.Rd new file mode 100644 index 0000000..576cc96 --- /dev/null +++ b/man/plot.pre_paleoTS.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.pre_paleoTS.R +\name{plot.pre_paleoTS} +\alias{plot.pre_paleoTS} +\title{plot pre-paleoTS objects} +\usage{ +\method{plot}{pre_paleoTS}(x, ...) +} +\arguments{ +\item{x}{object} + +\item{...}{other arguments} +} +\description{ +This functions throws an error on purpose, as \code{pre_paleoTS} objects can not be plotted directly. To plot them, first use \code{reduce_to_paleoTS} and use \code{plot} on the results +} +\examples{ +\dontrun{ +x = stasis_sl(1:4) +# throws error +plot(x) +library("paleoTS") +# correct way to plot pre-paleoTS objects +y = reduce_to_paleoTs(x) +plot(y) +# this plots via the procedures of the paleoTS package (which must be installed and loaded) +} + +} +\seealso{ +\code{\link[=reduce_to_paleoTS]{reduce_to_paleoTS()}} +}