cores: coresidency of a dyad

View source: R/cores.R

coresR Documentation

coresidency of a dyad

Description

coresidency of a dyad

Usage

cores(ID1, ID2, daterange, presence, outp, pr.dates = NULL)

Arguments

ID1

character, IDs

ID2

character, IDs

daterange

character of length 2, e.g. c("2010-01-01", "2010-04-04")

presence

character: name of presence data frame (i.e. in quotes), or matrix without date column. in the latter case make sure that pr.dates= is supplied

outp

"abs" (returning number of days), or "prop" (proportion of days given the date range), or "2days" (both IDs present on both dates), see details

pr.dates

optional character vector which corresponds to the presence= matrix. Should speed up computations in randomization tests if presence of two individuals on two specific days is needed.

Details

the outp="2days" option is useful only in the context of randomization procedures, and as such probably not useful for normal applications of the function.

if the pr.dates= argument is used this implies that the actual presence matrix is a true numeric matrix while the corresponding dates are in a separate vector (of the same length as the number of rows of the presence data set). So, it's probably also an argument that is not useful for the typical use.

Value

numeric, or logical

Examples

# load an example data set:
data(dataset3)
# extract the presence table from it:
pres <- dataset3$presence
head(pres)
cores("a", "d", daterange = c("2000-01-01", "2000-01-06"), presence = "pres", outp = "abs")
cores("a", "d", daterange = c("2000-05-01", "2000-06-01"), presence = "pres", outp = "prop")

gobbios/socialindices documentation built on Feb. 14, 2023, 3:56 p.m.