Skip to content

Commit

Permalink
Changed style and certain argument names of draw.sim. Changed example…
Browse files Browse the repository at this point in the history
…s in various functions to be in line with new draw.sim requirements. Updated NEWS.md. Added @Aliases field in paleobuddy.R to be in line with current roxygen requirements.
  • Loading branch information
brpetrucci committed Aug 24, 2023
1 parent 9337979 commit 419fa5d
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 279 deletions.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ S3method(summary,sim)
S3method(tail,sim)
export(bd.sim)
export(bd.sim.traits)
export(binarize)
export(bin.occurrences)
export(binner)
export(draw.sim)
export(find.lineages)
Expand All @@ -24,6 +24,7 @@ export(var.rate.div)
import(stats)
importFrom(grDevices,col2rgb)
importFrom(grDevices,rgb)
importFrom(graphics,legend)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
Expand Down
15 changes: 15 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ BiSSE, MuSSE, and QuaSSE. See documentation for full reference.
coming from `bd.sim.traits`) needs to include all states as observed
for that (see examples in `?sample.clade.traits` and vignettes for
details).
- `draw.sim` can now color longevity segments and fossil occurrences
based on the trait values of a given trait for each species through
time. Customization options include which colors to use for each
state, whether to plot fossils as true occurrence times or ranges
(already present in 1.0, but now with a dedicated argument for such,
`fossilsToDraw`), and where to place trait value legend. See
`?draw.sim`, `?bd.sim.traits`, `?sample.clade.traits`, and the
`overview` vignette for examples.

## Adding sampled ancestors to a phylogenetic tree

Expand All @@ -64,6 +72,13 @@ BiSSE, MuSSE, and QuaSSE. See documentation for full reference.
reviewer in the manuscript.
- Examples of new features for version 1.1 (see above) were added.

## Other additions

- `bin.occurrences` allows for ad-hoc binning of fossil occurrences, so
one can take a fossil record including only true times, i.e. an output
of `sample.clade(..., returnTrue = TRUE)`, and bin it to produce the
uncertainty in fossil ages ubiquitous in the true fossil record.

## Simple fixes

- `sample.clade.R`: added a small bit on help page to explain the
Expand Down
8 changes: 4 additions & 4 deletions R/binarize.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
#' fossils_true <- sample.clade(sim, rho = 1, tMax = 50, returnTrue = TRUE)
#'
#' # bin the true occurrences
#' fossils_binned <- binarize(fossils_true, bins)
#' fossils_binned <- bin.occurrences(fossils_true, bins)
#'
#' # compare
#' fossils_true
#' fossils_binned
#'
#' @name binarize
#' @rdname binarize
#' @name bin.occurrences
#' @rdname bin.occurrences
#' @export
#'

binarize <- function(fossils, bins) {
bin.occurrences <- function(fossils, bins) {
# sort bins in decreasing order
bins <- sort(bins, decreasing = TRUE)

Expand Down
Loading

0 comments on commit 419fa5d

Please sign in to comment.