clean_contact_address_history: Extracts address information from contact data

View source: R/clean_contact_address_history.R

clean_contact_address_historyR Documentation

Extracts address information from contact 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_contact_address_history(contacts, locations_clean, language_tokens)

Arguments

contacts

A tibble with contacts data. Contacts data is returned by get_contacts().

locations_clean

A tibble with cleaned locations data. Locations 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 data.

Examples

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

contacts <- get_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_address_history <- clean_contact_address_history(
  contacts = contacts,
  locations_clean = locations_clean,
  language_tokens = language_tokens
)

## End(Not run)

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