check: Check contact survey data

Description Usage Arguments Value Examples

View source: R/check.r

Description

Checks that a survey fulfills all the requirements to work with the 'contact_matrix' function

Usage

1
2
3
4
5
## S3 method for class 'survey'
check(x, columns = FALSE, quiet = FALSE,
  error = FALSE, id.column = "part_id",
  participant.age.column = "part_age", country.column = "country",
  year.column = "year", contact.age.column = "cnt_age", ...)

Arguments

x

A survey object

columns

if given, a named character vector containing the name of the "id", "participant.age" and "contact.age" columns

quiet

if TRUE, will not exit quietly if the test is passed.

error

if TRUE, will stop if an error is found in the structure of the participants and contacts data frame

id.column

the column in both the participants and contacts data frames that links contacts to participants

participant.age.column

the column in the participants data frame containing participants' age

country.column

the column in the participants data frame containing the country in which the participant was queried

year.column

the column in the participants data frame containing the year in which the participant was queried

contact.age.column

the column in the contacts data frame containing the age of contacts; if this does not exist, at least columns "..._exact", "..._est_min" and "..._est_max" must (see the estimated.contact.age option in contact_matrix)

...

ignored

Value

invisibly returns a character vector of the relevant columns

Examples

1
2

socialmixr documentation built on Sept. 24, 2019, 5:05 p.m.