clean_contacts_of_contacts_address_history: Extracts address information from contacts of contacts data

View source: R/clean_contacts_of_contacts_address_history.R

clean_contacts_of_contacts_address_historyR Documentation

Extracts address information from contacts of contacts data

Description

This function un-nests and cleans the address data and stores it in a standalone table with all addresses, even if there is more than 1 per person.

Usage

clean_contacts_of_contacts_address_history(
  contacts_of_contacts,
  locations_clean,
  language_tokens
)

Arguments

contacts_of_contacts

Atibble with contacts of contacts data. Contacts of contacts data is returned by get_contacts_of_contacts().

locations_clean

A tibble with cleaned location data. Location data is returned by get_locations() and cleaned by clean_locations().

language_tokens

A tibble of language tokens returned by get_language_tokens() to translate the string tokens in the data.

Value

A tibble with address information from contacts of contacts data.

Examples

## Not run: 
url <- "https://MyGoDataServer.com/"
username <- "myemail@email.com"
password <- "mypassword"
outbreak_id <- "3b5554d7-2c19-41d0-b9af-475ad25a382b"

contacts_of_contacts <- get_contacts_of_contacts(
  url = url,
  username = username,
  password = password,
  outbreak_id = outbreak_id
)

locations <- get_locations(
  url = url,
  username = username,
  password = password
)
locations_clean <- clean_locations(locations = locations)

language_tokens <- get_language_tokens(
  url = url,
  username = username,
  password = password,
  language = "english_us"
)

contact_of_contacts_add_hist <- clean_contacts_of_contacts_address_history(
  contacts_of_contacts = contacts_of_contacts,
  locations_clean = locations_clean,
  language_tokens = language_tokens
)

## End(Not run)

WorldHealthOrganization/godataR documentation built on May 21, 2023, 11:30 a.m.