diff --git a/man/clean_contacts.Rd b/man/clean_contacts.Rd index 02de61c..a5d5f90 100644 --- a/man/clean_contacts.Rd +++ b/man/clean_contacts.Rd @@ -35,56 +35,78 @@ Cleans and un-nests contact data. Contact data is returned by } \examples{ \dontrun{ - url <- "https://MyGoDataServer.com/" - username <- "myemail@email.com" - password <- "mypassword" - outbreak_id <- "3b5554d7-2c19-41d0-b9af-475ad25a382b" +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 - ) +contacts <- get_contacts( + url = url, + username = username, + password = password, + outbreak_id = outbreak_id +) + +locations <- get_locations( + url = url, + username = username, + password = password +) - locations <- get_locations( - url = url, - username = username, - password = password - ) +locations_clean <- clean_locations(locations = locations) - locations_clean <- clean_locations(locations = locations) +language_tokens <- get_language_tokens( + url = url, + username = username, + password = password, + language = "english_us" +) - # other cleaned data required for `clean_contacts()` - contacts_vacc_history_clean <- clean_contact_vax_history(contacts = contacts) - contacts_address_history_clean <- clean_contact_address_history( - contacts = contacts, - locations_clean = locations_clean - ) +# other cleaned data required for `clean_contacts()` +contacts_vacc_history_clean <- clean_contact_vax_history( + contacts = contacts, + language_tokens = language_tokens +) +contacts_address_history_clean <- clean_contact_address_history( + contacts = contacts, + locations_clean = locations_clean, + language_tokens = language_tokens +) - cases <- get_cases( - url = url, - username = username, - password = password, - outbreak_id = outbreak_id - ) - cases_address_history_clean <- clean_case_address_history(cases = cases) - cases_vacc_history_clean <- clean_case_vax_history(cases = cases) - cases_dateranges_history_clean <- clean_case_med_history(cases = cases) +cases <- get_cases( + url = url, + username = username, + password = password, + outbreak_id = outbreak_id +) +cases_address_history_clean <- clean_case_address_history( + cases = cases, + locations_clean = locations_clean, + language_tokens = language_tokens +) +cases_vacc_history_clean <- clean_case_vax_history( + cases = cases, + 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 - ) - contacts_becoming_cases <- cases_from_contacts(cases_clean = cases_clean) +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 +) +contacts_becoming_cases <- cases_from_contacts(cases_clean = cases_clean) - contacts_clean <- clean_contacts( - contacts = contacts, - contacts_address_history_clean = cases_address_history_clean, - contacts_vacc_history_clean = cases_vacc_history_clean, - contacts_becoming_cases = contacts_becoming_cases - ) +contacts_clean <- clean_contacts( + contacts = contacts, + contacts_address_history_clean = cases_address_history_clean, + contacts_vacc_history_clean = cases_vacc_history_clean, + contacts_becoming_cases = contacts_becoming_cases +) } } diff --git a/man/clean_followups.Rd b/man/clean_followups.Rd index 074c21d..a4d3745 100644 --- a/man/clean_followups.Rd +++ b/man/clean_followups.Rd @@ -4,7 +4,7 @@ \alias{clean_followups} \title{Clean followup data} \usage{ -clean_followups(followups, contacts_address_history_clean) +clean_followups(followups, contacts_address_history_clean, language_tokens) } \arguments{ \item{followups}{A \code{tibble} with events data. Followup data is returned by @@ -50,14 +50,23 @@ locations <- get_locations( locations_clean <- clean_locations(locations = locations) +language_tokens <- get_language_tokens( + url = url, + username = username, + password = password, + language = "english_us" +) + contacts_address_history_clean <- clean_contact_address_history( contacts = contacts, - locations_clean = locations_clean + locations_clean = locations_clean, + language_tokens = language_tokens ) followups_clean <- clean_followups( followups = followups, - contacts_address_history_clean = contacts_address_history_clean + contacts_address_history_clean = contacts_address_history_clean, + language_tokens = language_tokens ) } } diff --git a/man/clean_locations.Rd b/man/clean_locations.Rd index 0e2578b..3752796 100644 --- a/man/clean_locations.Rd +++ b/man/clean_locations.Rd @@ -4,7 +4,7 @@ \alias{clean_locations} \title{Cleans location data} \usage{ -clean_locations(locations) +clean_locations(locations, language_tokens) } \arguments{ \item{locations}{A \code{\link{tibble}} containing locations data. This is the data @@ -29,6 +29,13 @@ locations <- get_locations( password = password ) -clean_locations(locations = locations) +language_tokens <- get_language_tokens( + url = url, + username = username, + password = password, + language = "english_us" +) + +clean_locations(locations = locations, language_tokens = language_tokens) } } diff --git a/man/clean_relationships.Rd b/man/clean_relationships.Rd index e834893..cedab1a 100644 --- a/man/clean_relationships.Rd +++ b/man/clean_relationships.Rd @@ -4,7 +4,7 @@ \alias{clean_relationships} \title{Cleans relationship data} \usage{ -clean_relationships(relationships) +clean_relationships(relationships, language_tokens) } \arguments{ \item{relationships}{A \code{tibble} of relationship data. Relationship data is @@ -31,6 +31,16 @@ relationships <- get_relationships( outbreak_id = outbreak_id ) -clean_relationships <- clean_relationships(relationships) +language_tokens <- get_language_tokens( + url = url, + username = username, + password = password, + language = "english_us" +) + +clean_relationships <- clean_relationships( + relationships, + language_tokens = language_tokens +) } } diff --git a/man/clean_users.Rd b/man/clean_users.Rd index d06731b..8c9d11f 100644 --- a/man/clean_users.Rd +++ b/man/clean_users.Rd @@ -4,7 +4,7 @@ \alias{clean_users} \title{Cleans users data} \usage{ -clean_users(users) +clean_users(users, language_tokens) } \arguments{ \item{users}{A \code{tibble} containing users data. Users data is returned by @@ -29,6 +29,13 @@ users <- get_users( password = password ) -clean_users <- clean_users(users) +language_tokens <- get_language_tokens( + url = url, + username = username, + password = password, + language = "english_us" +) + +clean_users <- clean_users(users = users, language_tokens = language_tokens) } }