pr_sociality: Computes the proportion of time spent with at least one...

View source: R/pr_sociality.R

pr_socialityR Documentation

Computes the proportion of time spent with at least one conspecific

Description

The function computes, for every individual, the proportion of time it has been read in presence of at least one conspecific (read at the same second at the same antenna).

Usage

pr_sociality(block_df, block_ref_df, cutoff = 10)

Arguments

block_df

A data frame containing the reads from an experimental block

block_ref_df

A data frame containing a reference list with all individuals present in the experimental block.

cutoff

A value corresponding to the minimum number of total reads (both accompanied and non-accompanied) from which a sociability index (i.e. proportion of accompanied reads) should be computed. For example, if an individual has been read only once, by chance, in presence of a conspecific, a score of 100% for this individual is likely non-representative of the real proportion of time it spends in presence of conspecifics By default, the value if set at 10 total reads. For no cutoff, one can use a value of 0.

Value

A data table containing (i) the number of accompanied reads (i.e. reads for which at least another individual was present at the same antenna and at the same second); (ii) total number of reads; (iii) proportion of accompanied reads (proportion = acc_reads / tot_reads).

Examples


data(block_df)
data(block_ref_df)


pr_sociality(block_df,
            block_ref_df)

pr_sociality(block_df,
            block_ref_df,
            cutoff = 0)



AparajithaRamesh/pondr documentation built on Sept. 14, 2023, 7:14 p.m.