intervals_counts: Mean counts for specific time intervals

Description Usage Arguments Details Value Examples

Description

This function uses data (sample ages and sample counts) from an epd.entity.df-class object to calculate mean counts for samples within specific time intervals defined by the user. This can be used to estimate mean counts for the same time intervals for multiple entities or cores in the database, standardizing them for integrative analysis.

Usage

1
2
3
4
5
6
7
8
9
intervals_counts(x, tmin, tmax, chronology = NULL, newlabels = NULL)

## S4 method for signature 'epd.entity.df,numeric,numeric'
intervals_counts(x, tmin, tmax,
  chronology = NULL, newlabels = NULL)

## S4 method for signature 'epd.entity,numeric,numeric'
intervals_counts(x, tmin, tmax,
  chronology = NULL, newlabels = NULL)

Arguments

x

epd.entity.df An epd.entity.df-class object as returned by the entity_to_matrices function.

tmin

numeric Numeric vector indicating the lower limits (in years cal. BP) for the time intervals.

tmax

numeric Numeric vector indicating the upper limits (in years cal. BP) for the time intervals

chronology

numeric Number specifying the chronology from which ages should be used to calculate the interpolations. If none is provided the function uses the default chronology from the object (see giesecke_default_chron).

newlabels

character Character vector with labels for each time intervals, if none are provided the functions generate them with the following format tmin-tmax.

Details

Time intervals without sample (data) in the entity are fill with NA. This is convenient if analysis are carried out with multiple entities.

Value

The function returns a epd.entity.df-class object, similar to epd.entity.df in which ages and counts has been modified to the time intervarls specified and the counts estimated for these periods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
epd.connection <- connect_to_epd(host="localhost", database="epd",
                                 user="epdr", password="epdrpw")
epd.1 <- get_entity(1, epd.connection)
epd.1.int <- intervals_counts(epd.1, tmin = seq(0, 21000, by = 1000),
                              tmax = seq(999, 21999, by = 1000))
epd.3 <- get_entity(3, epd.connection)
epd.3.int <- intervals_counts(epd.3, tmin = seq(0, 21000, by = 1000),
                              tmax = seq(999, 21999, by = 1000))
epd.3.int <- intervals_counts(epd.3, tmin = seq(0, 21000, by = 1000),
                              tmax = seq(999, 21999, by = 1000), 2)

## End(Not run)

dinilu/EPDr documentation built on Aug. 22, 2019, 1:03 p.m.