Obtain a wide table with information regarding of samples grouped by variablename and depth/age.

toWide(
  x,
  variablenames = NA,
  ecologicalgroups = NA,
  elementtypes = NA,
  unit = NA,
  groupby = "age",
  operation = "prop"
)

Arguments

x

dataframe object with samples

variablenames

Optional vector to filter by specific variable names.

ecologicalgroups

Vector stating the ecological groups to be filtered by, e.g "DIAT", "TRSH"

elementtypes

Label of element type to filter by, e.g. "pollen", "valve"

unit

Label stating which units to filter by, e.g. "NISP"

groupby

Group by 'age' or 'depth'

operation

label or vector of operations to be chosen from: 'prop', 'sum', 'presence'.

Value

wide data.frame obtained from long samples data.frame

Author

Socorro Dominguez dominguezvid@wisc.edu

Examples

# \donttest{
tryCatch({
fc_sites <- neotoma2::get_datasets(limit=5, datasettype = "vertebrate fauna")
fc_ds <- fc_sites %>%
   neotoma2::get_downloads()
fc_dl1 <- fc_dl[[1]]
fc_smp <- samples(fc_dl1)
toWide(fc_smp, ecologicalgroups=c('AVES', 'RODE'),
       elementtypes='bone/tooth', unit='present/absent')
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
#> Neotoma server not responding. Try again later.
# }