Learn R Programming

OutbreakTools (version 0.1-13)

get.individuals: Retrieve individual identifiers

Description

get.individuals is a generic function with a method for obkData, obkSequences and obkContacts objects. It can be used to retrieve individuals identifiers stored in the object.

Usage

get.individuals(x, ...)

get.nindividuals(x, ...)

## S3 method for class 'obkData': get.individuals(x, data=c("all", "individuals", "records", "contacts", "dna"), ...)

## S3 method for class 'obkData': get.nindividuals(x, data=c("all", "individuals", "records", "contacts", "dna"), ...)

## S3 method for class 'obkSequences': get.individuals(x, \dots)

## S3 method for class 'obkSequences': get.nindividuals(x, \dots)

## S3 method for class 'obkContacts': get.individuals(x, \dots)

## S3 method for class 'obkContacts': get.nindividuals(x, \dots)

Arguments

x
an input object to seek individuals from.
data
a character string indicating the name of the data field to look for. It can be 'all'(default), 'individuals', 'records' or 'context'.
...
currently not used.

Examples

Run this code
## LOAD DATA ##
data(ToyOutbreak)

## VARIOUS USE OF GET.INDIVIDUALS ##
get.individuals(ToyOutbreak)

get.nindividuals(ToyOutbreak, "records")
get.individuals(ToyOutbreak, "records")

get.nindividuals(ToyOutbreak, "contacts")
get.individuals(ToyOutbreak, "contacts")

Run the code above in your browser using DataLab