clean_cases: Cleans case data

View source: R/clean_cases.R

clean_casesR Documentation

Cleans case data

Description

Cleans and un-nests case data. Case data is returned by get_cases().

Usage

clean_cases(
  cases,
  cases_address_history_clean,
  cases_vacc_history_clean,
  cases_dateranges_history_clean,
  language_tokens
)

Arguments

cases

A tibble containing the case data.

language_tokens

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

locations_clean

A tibble with cleaned locations data. Locations data is returned by get_locations() and cleaned by clean_locations().

Value

A tibble containing the cleaned case data.

Examples

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

cases <- get_cases(
  url = url,
  username = username,
  password = password,
  outbreak_id = outbreak_id
)

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

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

# other cleaned data required for `clean_cases()`
cases_vacc_history_clean <- clean_case_vax_history(
  cases = cases,
  language_tokens = language_tokens
)
cases_address_history_clean <- clean_case_address_history(
  cases = cases,
  locations_clean = locations_clean,
  language_tokens = language_tokens
)
cases_dateranges_history_clean <- clean_case_med_history(
  cases = cases,
  language_tokens = language_tokens
)

cases_clean <- clean_cases(
  cases = cases,
  cases_address_history_clean = cases_address_history_clean,
  cases_vacc_history_clean = cases_vacc_history_clean,
  cases_dateranges_history_clean = cases_dateranges_history_clean,
  language_tokens = language_tokens
)

## End(Not run)

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