Skip to contents

The function calls get_opentree_chronograms() to update the OpenTree chronograms database cached in datelife. It has the option to write the updated object as an .Rdata file, that will be independent of the opentree_chronograms data object that you can load with data("opentree_chronograms", package = "datelife").

Usage

update_datelife_cache(
  write = TRUE,
  updated_name = "opentree_chronograms_updated",
  file_path = file.path(tempdir()),
  ...
)

Arguments

write

Defaults to TRUE, it saves an .Rdata file named indicated by argument name, containing available chronograms from Open Tree of Life. Saves to path indicated by argument path.

updated_name

Used if write = TRUE. Defaults to "opentree_chronograms_updated". A character vector of length one indicating the name to assign to both the updated OpenTree chronogram database object and the ".Rdata" file. For example, if name = "my_database", the function will assign the updated chronogram database to an object named my_database and will write it to a file named "my_database.Rdata" in the path indicated by argument file_path.

file_path

Used if write = TRUE. A character vector of length 1 indicating the path to write the updated database ".Rdata" file to, excluding file name. Defaults to temporary directory obtained with base::tempdir() and formatted with base::file.path().

...

Arguments passed on to get_opentree_chronograms

max_tree_count

Default to "all", it gets all available chronograms. For testing purposes, a numeric value indicating the max number of trees to be cached.

Value

A list of 4 elements:

authors

A list of lists of author names of the original studies that published chronograms currently stored in the Open Tree of Life database.

curators

A list of lists of curator names that uploaded chronograms to the Open Tree of Life database.

studies

A list of study identifiers from original studies that published chronograms currently stored in the Open Tree of Life database.

trees

A multiPhylo object storing the chronograms from Open Tree of Life database.

update

A character vector indicating the time when the database object was last updated.

version

A character vector indicating the datelife package version when the object was last updated.