diff --git a/R/create-request.R b/R/create-request.R index 2ef7871..2453ed1 100644 --- a/R/create-request.R +++ b/R/create-request.R @@ -1,25 +1,26 @@ #' Create Request to State Cancer Profile Data -#' +#' #' This creates a request to the State Cancer Profiles URL -#' +#' #' @param topic Either "demographics", "risk", "incidencerates", "deathrates" -#' +#' #' @importFrom httr2 request -#' -#' @returns returns the HTTP method with the state cancer profiles url and the http path -#' +#' +#' @returns returns the HTTP method with the state cancer profiles +#' url and the http path +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' create_request("demographics") #' create_request("risk") #' } create_request <- function(topic) { - url = "https://statecancerprofiles.cancer.gov/" - url_end = "/index.php" - - url = paste0(url, topic, url_end) - + url <- "https://statecancerprofiles.cancer.gov/" + url_end <- "/index.php" + + url <- paste0(url, topic, url_end) + request(url) } diff --git a/R/demo-crowding.R b/R/demo-crowding.R index 071fdba..165f274 100644 --- a/R/demo-crowding.R +++ b/R/demo-crowding.R @@ -1,6 +1,6 @@ #' Access to Crowding Data -#' -#' This function returns a data frame about crowding demographics from State +#' +#' This function returns a data frame about crowding demographics from State #' Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. @@ -8,9 +8,9 @@ #' - `"county"` #' - `"hsa"` (Health Service Area) #' - `"state"`. -#' @param crowding The only permissible value is +#' @param crowding The only permissible value is #' `"household with >1 person per room"`. -#' @param race +#' @param race #' One of the following values: #' - `"All Races (includes Hispanic)"` #' - `"White (includes Hispanic)"` @@ -19,66 +19,75 @@ #' - `"Amer. Indian/Alaskan Native (includes Hispanic)"` #' - `"Asian or Pacific Islander (includes Hispanic)"` #' - `"Hispanic (Any Race)"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom stats setNames #' @importFrom dplyr mutate across -#' -#' @returns A data frame with the following columns: Area, Area Code, +#' +#' @returns A data frame with the following columns: Area, Area Code, #' Percent, Households, Rank. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' demo_crowding(area = "WA", -#' areatype = "hsa", -#' crowding = "household with >1 person per room", -#' race = "All Races (includes Hispanic)") -#' -#' demo_crowding(area = "usa", -#' areatype = "state", -#' crowding = "household with >1 person per room", -#' race = "All Races (includes Hispanic)") +#' demo_crowding( +#' area = "WA", +#' areatype = "hsa", +#' crowding = "household with >1 person per room", +#' race = "All Races (includes Hispanic)" +#' ) +#' +#' demo_crowding( +#' area = "usa", +#' areatype = "state", +#' crowding = "household with >1 person per room", +#' race = "All Races (includes Hispanic)" +#' ) #' -#' demo_crowding(area = "pr", -#' areatype = "hsa", -#' crowding = "household with >1 person per room", -#' race = "black") +#' demo_crowding( +#' area = "pr", +#' areatype = "hsa", +#' crowding = "household with >1 person per room", +#' race = "black" +#' ) #' } -#' -demo_crowding <- function(area, areatype, - crowding = "household with >1 person per room", +#' +demo_crowding <- function(area, areatype, + crowding = "household with >1 person per room", race) { - areatype <- tolower(areatype) req <- create_request("demographics") - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=areatype, - topic="crowd", - demo=handle_crowding(crowding), - race=handle_race(race), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% + stateFIPS = fips_scp(area), + areatype = areatype, + topic = "crowd", + demo = handle_crowding(crowding), + race = handle_race(race), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% req_perform() - + resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", - "state" = "State") + + areatype_map <- c( + "county" = "County", "hsa" = "Health_Service_Area", + "state" = "State" + ) areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") - + areatype_title <- areatype_map[areatype] areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Percent", - "Households", "Rank")) %>% + + resp %>% + setNames(c( + areatype_title, areacode_title, "Percent", + "Households", "Rank" + )) %>% mutate(across(c("Percent", "Households"), \(x) as.numeric(x))) } diff --git a/R/demo-education.R b/R/demo-education.R index c1ae2c0..0d866ae 100644 --- a/R/demo-education.R +++ b/R/demo-education.R @@ -1,6 +1,7 @@ #' Access to Education Data #' -#' This function returns a data frame about education demographics from State Cancer Profiles. +#' This function returns a data frame about education demographics from +#' State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype One of the following values: @@ -28,32 +29,38 @@ #' @importFrom cli cli_abort #' @importFrom stats setNames #' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, Households, Rank. #' #' @export #' #' @examples #' \dontrun{ -#' demo_education(area = "wa", -#' areatype = "county", -#' education = "at least high school", -#' sex = "males") -#' -#' demo_education(area = "usa", -#' areatype = "state", -#' education = "at least bachelors degree", -#' sex = "both sexes", -#' race = "all races (includes hispanic)") -#' -#' demo_education(area = "pr", -#' areatype = "hsa", -#' education = "less than 9th grade") +#' demo_education( +#' area = "wa", +#' areatype = "county", +#' education = "at least high school", +#' sex = "males" +#' ) +#' +#' demo_education( +#' area = "usa", +#' areatype = "state", +#' education = "at least bachelors degree", +#' sex = "both sexes", +#' race = "all races (includes hispanic)" +#' ) +#' +#' demo_education( +#' area = "pr", +#' areatype = "hsa", +#' education = "less than 9th grade" +#' ) #' } -demo_education <- function(area, areatype, education, sex=NULL, race=NULL) { - +demo_education <- function(area, areatype, education, sex = NULL, race = NULL) { req <- create_request("demographics") - if(education == "less than 9th grade" && (!is.null(race) || !is.null(sex))) { + if (education == "less than 9th grade" && (!is.null(race) || !is.null(sex))) { cli_abort("For Less than 9th Grade, Race and Sex must be NULL.") } else if (education == "at least high school" && (!is.null(race) || is.null(sex))) { cli_abort("For At Least High School, Race must be NULL and Sex must be NOT NULL.") @@ -63,37 +70,37 @@ demo_education <- function(area, areatype, education, sex=NULL, race=NULL) { resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="ed", - demo=handle_education(education), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "ed", + demo = handle_education(education), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 ) - if(!is.null(race)) { - resp <- resp %>% - req_url_query(race=handle_race(race)) - } - - if(!is.null(sex)) { - resp <- resp %>% - req_url_query(sex=handle_sex(sex)) - } + if (!is.null(race)) { + resp <- resp %>% + req_url_query(race = handle_race(race)) + } + if (!is.null(sex)) { resp <- resp %>% - req_perform() + req_url_query(sex = handle_sex(sex)) + } + + resp <- resp %>% + req_perform() + + resp <- process_response(resp) + + areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") + + areatype_title <- areatype_map[areatype] + areacode_title <- areacode_map[areatype] - resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") - areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") - - areatype_title <- areatype_map[areatype] - areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) + resp %>% + setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) } diff --git a/R/demo-food-access.R b/R/demo-food-access.R index 5ea20ce..4edf4e9 100644 --- a/R/demo-food-access.R +++ b/R/demo-food-access.R @@ -1,10 +1,11 @@ #' Access to Food Insecurity Data -#' -#' This function returns a data frame about food demographics from State Cancer Profiles. +#' +#' This function returns a data frame about food demographics from +#' State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype Either `"county"` or `"state"`. -#' @param food One of the following values: +#' @param food One of the following values: #' - `"food insecurity"` #' - `"limited access to healthy food"`. #' @param race One of the following values: @@ -12,72 +13,78 @@ #' - `"White non-Hispanic"` #' - `"Black (includes Hispanic)"` #' - `"Hispanic (Any Race)`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' @importFrom dplyr mutate #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Value, People". -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Value, People. +#' #' @export #' #' @examples #' \dontrun{ -#' demo_food(area = "wa", -#' areatype = "county", -#' food = "food insecurity", -#' race = "black") -#' -#' demo_food(area = "usa", -#' areatype = "state", -#' food = "limited access to healthy food") -#' -#' demo_food(area = "pr", -#' areatype = "county", -#' food = "food insecurity", -#' race = "all races (includes hispanic)") +#' demo_food( +#' area = "wa", +#' areatype = "county", +#' food = "food insecurity", +#' race = "black" +#' ) +#' +#' demo_food( +#' area = "usa", +#' areatype = "state", +#' food = "limited access to healthy food" +#' ) +#' +#' demo_food( +#' area = "pr", +#' areatype = "county", +#' food = "food insecurity", +#' race = "all races (includes hispanic)" +#' ) #' } -demo_food <- function(area, areatype, food, race=NULL) { - +demo_food <- function(area, areatype, food, race = NULL) { req <- create_request("demographics") - + if (food == "limited access to healthy food" && !is.null(race)) { cli_abort("For limited access to healthy food, Race must be NULL.") } else if (food == "food insecurity" && is.null(race)) { cli_abort("For food insecurity, Race must NOT be NULL.") } - - req_draft <- req %>% + + req_draft <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="food", - demo=handle_food(food), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "food", + demo = handle_food(food), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 ) - - if(!is.null(race)) { - req_draft <- req_draft %>% - req_url_query(race=handle_race(race)) + + if (!is.null(race)) { + req_draft <- req_draft %>% + req_url_query(race = handle_race(race)) } - + resp <- req_draft %>% - req_perform() - - resp <- process_response(resp) %>% - mutate(Value..Percent. = as.integer(Value..Percent.)) - + req_perform() + + resp <- process_response(resp) %>% + mutate(Value..Percent. = as.integer(Value..Percent.)) + areatype_map <- c("county" = "County", "state" = "State") areatype_title <- areatype_map[areatype] - + if (food == "limited access to healthy food") { - resp %>% + resp %>% setNames(c(areatype_title, "FIPS", "Percent", "People")) - } else if (food == "food insecurity"){ + } else if (food == "food insecurity") { resp %>% setNames(c(areatype_title, "FIPS", "Percent")) } diff --git a/R/demo-income.R b/R/demo-income.R index 44de89b..17e1611 100644 --- a/R/demo-income.R +++ b/R/demo-income.R @@ -1,6 +1,7 @@ #' Access to Income Data -#' -#' This function returns a data frame about income demographics from State Cancer Profiles. +#' +#' This function returns a data frame about income demographics from +#' State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype Either `"county"` or `"state"`. @@ -13,57 +14,63 @@ #' - `"Amer. Indian/Alaskan Native (includes Hispanic)"` #' - `"Asian or Pacific Islander (includes Hispanic)"` #' - `"Hispanic (Any Race)`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' @importFrom dplyr mutate #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Dollars, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Dollars, Rank. +#' #' @export -#' -#' @examples +#' +#' @examples #' \dontrun{ -#' demo_income(area = "wa", -#' areatype = "county", -#' income = "median household income", -#' race = "all races (includes hispanic)") -#' -#' demo_income(area = "usa", -#' areatype = "state", -#' income = "median family income", -#' race = "all races (includes hispanic)") -#' -#' demo_income(area = "pr", -#' areatype = "county", -#' income = "median family income", -#' race = "all races (includes hispanic)") +#' demo_income( +#' area = "wa", +#' areatype = "county", +#' income = "median household income", +#' race = "all races (includes hispanic)" +#' ) +#' +#' demo_income( +#' area = "usa", +#' areatype = "state", +#' income = "median family income", +#' race = "all races (includes hispanic)" +#' ) +#' +#' demo_income( +#' area = "pr", +#' areatype = "county", +#' income = "median family income", +#' race = "all races (includes hispanic)" +#' ) #' } demo_income <- function(area, areatype, income, race) { - req <- create_request("demographics") - + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="inc", - demo=handle_income(income), - race=handle_race(race), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% - req_perform() - - resp <- process_response(resp) %>% + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "inc", + demo = handle_income(income), + race = handle_race(race), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% + req_perform() + + resp <- process_response(resp) %>% mutate(Value..Dollars. = as.integer(Value..Dollars.)) - + areatype_map <- c("county" = "County", "state" = "State") areatype_title <- areatype_map[areatype] - - resp %>% + + resp %>% setNames(c(areatype_title, "FIPS", "Dollars", "Rank")) } diff --git a/R/demo-insurance.R b/R/demo-insurance.R index 61d84c8..2aa4e28 100644 --- a/R/demo-insurance.R +++ b/R/demo-insurance.R @@ -31,7 +31,7 @@ #' - `"40 to 64 years"` #' - `"50 to 64 years"` #' - `"under 65 years"`. -#' +#' #' Otherwise if you specified `"male"` or `"female"` for `sex`, choose one of the following values: #' - `"18 to 64 years"` #' - `"40 to 64 years"` @@ -44,86 +44,93 @@ #' - `"American Indian / Alaska Native (non-Hispanic)"` #' - `"Asian (non-Hispanic)"` #' - `"Hispanic (Any Race)"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' #' @returns A data frame with the following columns: Area Type, Area Code, Percent, People, Rank. -#' +#' #' @export #' #' @examples #' \dontrun{ -#' demo_insurance(area = "usa", -#' areatype = "state", -#' insurance = "% Insured in demographic group, all income levels", -#' sex = "both sexes", -#' age = "18 to 64 years", -#' race = "white (non-hispanic)") -#' -#' demo_insurance(area = "wa", -#' areatype = "hsa", -#' insurance = "% Insured in demographic group, all income levels", -#' sex = "males", -#' age = "18 to 64 years") -#' -#' demo_insurance(area = "dc", -#' areatype = "county", -#' insurance = "% Insured in demographic group, all income levels", -#' sex = "males", -#' age = "18 to 64 years") +#' demo_insurance( +#' area = "usa", +#' areatype = "state", +#' insurance = "% Insured in demographic group, all income levels", +#' sex = "both sexes", +#' age = "18 to 64 years", +#' race = "white (non-hispanic)" +#' ) +#' +#' demo_insurance( +#' area = "wa", +#' areatype = "hsa", +#' insurance = "% Insured in demographic group, all income levels", +#' sex = "males", +#' age = "18 to 64 years" +#' ) +#' +#' demo_insurance( +#' area = "dc", +#' areatype = "county", +#' insurance = "% Insured in demographic group, all income levels", +#' sex = "males", +#' age = "18 to 64 years" +#' ) #' } -demo_insurance <- function(area, areatype, insurance, sex, age, race=NULL) { - - not_all_races <- c("white non hispanic", "black non hispanic", "american indian / alaska native non-hispanic", - "asian non-hispanic", "hispanic (any race)") - - +demo_insurance <- function(area, areatype, insurance, sex, age, race = NULL) { + not_all_races <- c( + "white non hispanic", "black non hispanic", "american indian / alaska native non-hispanic", + "asian non-hispanic", "hispanic (any race)" + ) + + req <- create_request("demographics") - - if ((sex == "males" || sex == "females") & (age == "under 19 years" || age =="21 to 64 years")) { + + if ((sex == "males" || sex == "females") & (age == "under 19 years" || age == "21 to 64 years")) { cli_abort("For males and females, age CANNOT be under 19 years OR 21 to 64 years") } else if (areatype == "state" && is.null(race)) { cli_abort("For areatype State, Race must not be null") - } else if ((areatype == "state" && race %in% not_all_races) && (age == "under 19 years" || age =="21 to 64 years")) { + } else if ((areatype == "state" && race %in% not_all_races) && (age == "under 19 years" || age == "21 to 64 years")) { cli_abort("For state data, only all races can have values under 19 years OR 21 to 64 years") } - + if ((areatype == "county" || areatype == "hsa") && !is.null(race)) { cli_abort("For areatype County and HSA, Race must be NULL.") } - + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="ins", - demo=handle_insurance(insurance), - race=handle_race(race), - sex=handle_sex(sex), - age=handle_age(age), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "ins", + demo = handle_insurance(insurance), + race = handle_race(race), + sex = handle_sex(sex), + age = handle_age(age), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 ) - - if(!is.null(race)) { + + if (!is.null(race)) { resp <- resp %>% - req_url_query(race=handle_race(race)) + req_url_query(race = handle_race(race)) } - + resp <- resp %>% req_perform() resp <- process_response(resp) - + areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] - - resp %>% + + resp %>% setNames(c(areatype_title, areacode_title, "Percent", "People", "Rank")) } diff --git a/R/demo-mobility.R b/R/demo-mobility.R index ccbb119..5d0eb9b 100644 --- a/R/demo-mobility.R +++ b/R/demo-mobility.R @@ -1,66 +1,77 @@ #' Access to Mobility Data -#' -#' This function returns a data frame about mobility demographics from State Cancer Profiles. +#' +#' This function returns a data frame about mobility demographics +#' from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype One of the following values: #' - `"county"` #' - `"hsa"` (Health Service Area) #' - `"state"`. -#' @param mobility The only permissible values are +#' @param mobility The only permissible values are #' - `"i haven't moved (in past year)"` #' - `"moved from outside us (in past year)"` #' - `"moved, different state (in past year)"` #' - `"moved, different county, same state (in past year)"` #' - `"moved, same county (in past year)"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, People, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, People, Rank. +#' #' @export -#' -#' @examples +#' +#' @examples #' \dontrun{ -#' demo_mobility(area = "WA", -#' areatype = "county", -#' mobility = "moved, different county, same state (in past year)") -#' -#' demo_mobility(area = "usa", -#' areatype = "state", -#' mobility = "moved, same county (in past year)") -#' -#' demo_mobility(area = "dc", -#' areatype = "hsa", -#' mobility = "moved, same county (in past year)") +#' demo_mobility( +#' area = "WA", +#' areatype = "county", +#' mobility = "moved, different county, same state (in past year)" +#' ) +#' +#' demo_mobility( +#' area = "usa", +#' areatype = "state", +#' mobility = "moved, same county (in past year)" +#' ) +#' +#' demo_mobility( +#' area = "dc", +#' areatype = "hsa", +#' mobility = "moved, same county (in past year)" +#' ) #' } demo_mobility <- function(area, areatype, mobility) { - req <- create_request("demographics") - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="mob", - demo=handle_mobility(mobility), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "mob", + demo = handle_mobility(mobility), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% req_perform() - resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") - areatype_title <- areatype_map[areatype] - - areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") - areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) + resp <- process_response(resp) + + areatype_map <- c( + "county" = "County", + "hsa" = "Health_Service_Area", + "state" = "State" + ) + areatype_title <- areatype_map[areatype] + + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") + areacode_title <- areacode_map[areatype] + + resp %>% + setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) } diff --git a/R/demo-non-english-language.R b/R/demo-non-english-language.R index 1170db0..713b75c 100644 --- a/R/demo-non-english-language.R +++ b/R/demo-non-english-language.R @@ -1,60 +1,72 @@ #' Access to Non-English Language -#' -#' This function returns a data frame about language demographics from State Cancer Profiles. +#' +#' This function returns a data frame about language demographics +#' from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype One of the following values: #' - `"county"` #' - `"hsa"` (Health Service Area) #' - `"state"`. -#' @param language The only permissible value is +#' @param language The only permissible value is #' `"language isolation"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, Households, Rank. +#' #' @export -#' -#' @examples -#' demo_language(area = "WA", -#' areatype = "county", -#' language = "language isolation") -#' -#' demo_language(area = "dc", -#' areatype = "hsa", -#' language = "language isolation") -#' -#' demo_language(area = "usa", -#' areatype = "state", -#' language = "language isolation") +#' +#' @examples +#' demo_language( +#' area = "WA", +#' areatype = "county", +#' language = "language isolation" +#' ) +#' +#' demo_language( +#' area = "dc", +#' areatype = "hsa", +#' language = "language isolation" +#' ) +#' +#' demo_language( +#' area = "usa", +#' areatype = "state", +#' language = "language isolation" +#' ) demo_language <- function(area, areatype, language) { - req <- create_request("demographics") - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="lang", - demo=handle_non_english(language), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "lang", + demo = handle_non_english(language), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% req_perform() - - + + resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") + + areatype_map <- c( + "county" = "County", + "hsa" = "Health_Service_Area", + "state" = "State" + ) + areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] - - resp %>% + + resp %>% setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) } diff --git a/R/demo-population.R b/R/demo-population.R index 81d96e3..64e3c8a 100644 --- a/R/demo-population.R +++ b/R/demo-population.R @@ -1,6 +1,7 @@ #' Access to Population Data -#' -#' This function returns a data frame from population in State Cancer Profiles. +#' +#' This function returns a data frame about population +#' from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype One of the following values: @@ -35,88 +36,97 @@ #' - `"both sexes"` #' - `"male"` #' - `"female"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, Households, Rank. +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' demo_population(area = "WA", -#' areatype = "county", -#' population = "males", -#' race = "all races (includes hispanic)") -#' -#' demo_population(area = "dc", -#' areatype = "hsa", -#' population = "foreign born", -#' race = "black", -#' sex = "females") -#' -#' demo_population(area = "usa", -#' areatype = "state", -#' population = "foreign born", -#' race = "hispanic (any race)", -#' sex = "females") -#' +#' demo_population( +#' area = "WA", +#' areatype = "county", +#' population = "males", +#' race = "all races (includes hispanic)" +#' ) +#' +#' demo_population( +#' area = "dc", +#' areatype = "hsa", +#' population = "foreign born", +#' race = "black", +#' sex = "females" +#' ) +#' +#' demo_population( +#' area = "usa", +#' areatype = "state", +#' population = "foreign born", +#' race = "hispanic (any race)", +#' sex = "females" +#' ) #' } -demo_population <- function(area, areatype, population, race=NULL, sex=NULL) { - +demo_population <- function(area, areatype, population, race = NULL, sex = NULL) { req <- create_request("demographics") - - if((population == "ages 40 and over" || population == "ages 50 and over") && (!is.null(race) || !is.null(sex))) { + + if ((population == "ages 40 and over" || population == "ages 50 and over") && (!is.null(race) || !is.null(sex))) { cli_abort("ages 40 and over and ages 50 and over, Race and Sex must be NULL") - } else if((population == "age 18-39" || population == "age 40-64") && (is.null(sex) || !is.null(race))) { + } else if ((population == "age 18-39" || population == "age 40-64") && (is.null(sex) || !is.null(race))) { cli_abort("for ages 18-39 and age 40-64, Sex must not be NULL and Race must be NULL") - } else if((population == "age under 18" || population == "ages 60 and over") && (is.null(sex) || is.null(race))) { + } else if ((population == "age under 18" || population == "ages 60 and over") && (is.null(sex) || is.null(race))) { cli_abort("for age under 18 and ages 60 and over, Sex and Race must not be NULL") - } else if((population == "males" || population == "females") && (is.null(race) || !is.null(sex))) { + } else if ((population == "males" || population == "females") && (is.null(race) || !is.null(sex))) { cli_abort("for males, Race must not be NULL and Sex must be NULL") - } else if(population == "foreign born" && (is.null(race) || is.null(sex))) { + } else if (population == "foreign born" && (is.null(race) || is.null(sex))) { cli_abort("for foreign born, race and sex must not be NULL") } else if ((population == "american indian/alaska native" || population == "asian/pacific islander" || population == "black" || - population == "hispanic" || population == "non-hispanic (origin recode)" || - population == "white") && (is.null(sex) || !is.null(race))) { + population == "hispanic" || population == "non-hispanic (origin recode)" || + population == "white") && (is.null(sex) || !is.null(race))) { cli_abort("for races other than foreign born, Sex must not be NULL and race must be NULL") } - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="pop", - demo=handle_population(population), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) - - if(!is.null(race)) { - resp <- resp %>% - req_url_query(race=handle_race(race)) - } - - if(!is.null(sex)) { - resp <- resp %>% - req_url_query(sex=handle_sex(sex)) - } - - resp <- resp %>% - req_perform() - - resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") - areatype_title <- areatype_map[areatype] - - areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") - areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "pop", + demo = handle_population(population), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) + + if (!is.null(race)) { + resp <- resp %>% + req_url_query(race = handle_race(race)) + } + + if (!is.null(sex)) { + resp <- resp %>% + req_url_query(sex = handle_sex(sex)) + } + + resp <- resp %>% + req_perform() + + resp <- process_response(resp) + + areatype_map <- c( + "county" = "County", + "hsa" = "Health_Service_Area", + "state" = "State" + ) + areatype_title <- areatype_map[areatype] + + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") + areacode_title <- areacode_map[areatype] + + resp %>% + setNames(c(areatype_title, areacode_title, "Percent", "Households", "Rank")) } diff --git a/R/demo-poverty.R b/R/demo-poverty.R index 333fe37..bc47db3 100644 --- a/R/demo-poverty.R +++ b/R/demo-poverty.R @@ -1,6 +1,7 @@ #' Access to Poverty Data -#' -#' This function returns a data frame about poverty demographics from State Cancer Profiles. +#' +#' This function returns a data frame about poverty demographics +#' from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param areatype One of the following values: @@ -24,80 +25,90 @@ #' - `"both sexes"` #' - `"male"` #' - `"female"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, Households, Rank. +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' demo_poverty(area = "WA", -#' areatype = "county", -#' poverty = "persistent poverty") -#' -#' demo_poverty(area = "usa", -#' areatype = "state", -#' poverty = "families below poverty", -#' race = "black") -#' -#' demo_poverty(area = "dc", -#' areatype = "hsa", -#' poverty = "families below poverty", -#' race = "All Races (includes Hispanic)") +#' demo_poverty( +#' area = "WA", +#' areatype = "county", +#' poverty = "persistent poverty" +#' ) +#' +#' demo_poverty( +#' area = "usa", +#' areatype = "state", +#' poverty = "families below poverty", +#' race = "black" +#' ) +#' +#' demo_poverty( +#' area = "dc", +#' areatype = "hsa", +#' poverty = "families below poverty", +#' race = "All Races (includes Hispanic)" +#' ) #' } -demo_poverty <- function(area, areatype, poverty, race=NULL, sex=NULL) { - +demo_poverty <- function(area, areatype, poverty, race = NULL, sex = NULL) { req <- create_request("demographics") - + if (poverty == "persistent poverty" && (areatype == "hsa" || areatype == "state")) { cli_abort("For persistent poverty, areatype must be county") } if ((poverty == "persistent poverty" || poverty == "persons < 150% of poverty") && (!is.null(race) || !is.null(sex))) { cli_abort("for persistent poverty and persons < 150% of poverty, Race and Sex must be NULL") - } else if((poverty == "families below poverty") && (!is.null(sex) || is.null(race))) { + } else if ((poverty == "families below poverty") && (!is.null(sex) || is.null(race))) { cli_abort("for families below poverty, Sex must be NULL and Race must not be NULL") - } else if((poverty == "persons below poverty") && (is.null(sex) || is.null(race))) { + } else if ((poverty == "persons below poverty") && (is.null(sex) || is.null(race))) { cli_abort("for persons below poverty, Sex and Race must not be NULL") } - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="pov", - demo=handle_poverty(poverty), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) - - if(!is.null(race)) { + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "pov", + demo = handle_poverty(poverty), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) + + if (!is.null(race)) { resp <- resp %>% - req_url_query(race=handle_race(race)) + req_url_query(race = handle_race(race)) } - - if(!is.null(sex)) { + + if (!is.null(sex)) { resp <- resp %>% - req_url_query(sex=handle_sex(sex)) + req_url_query(sex = handle_sex(sex)) } - - resp <- resp %>% + + resp <- resp %>% req_perform() resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") + + areatype_map <- c( + "county" = "County", + "hsa" = "Health_Service_Area", + "state" = "State" + ) areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] - + if (poverty == "persistent poverty") { - resp %>% + resp %>% setNames(c(areatype_title, areacode_title, "Persistent Poverty")) } else { resp %>% diff --git a/R/demo-svi.R b/R/demo-svi.R index 411744a..4c422a8 100644 --- a/R/demo-svi.R +++ b/R/demo-svi.R @@ -1,6 +1,7 @@ #' Access to Social Vulnerability Index (SVI) Data -#' -#' This function returns a data frame from social vulnerability index (SVI) in State Cancer Profiles. +#' +#' This function returns a data frame about social vulnerability index (SVI) +#' from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. #' @param svi One of the following values: @@ -9,46 +10,50 @@ #' - `"household characteristics"` #' - `"racial & ethinic minority status"` #' - `"housing type & transportation"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns County, FIPS, Score. -#' +#' +#' @returns A data frame with the following columns: County, FIPS, Score. +#' #' @export -#' -#' @examples +#' +#' @examples #' \dontrun{ -#' demo_svi(area = "WA", -#' svi = "overall") -#' -#' demo_svi(area = "usa", -#' svi = "overall") -#' -#' demo_svi(area = "dc", -#' svi = "socioeconomic status") +#' demo_svi( +#' area = "WA", +#' svi = "overall" +#' ) +#' +#' demo_svi( +#' area = "usa", +#' svi = "overall" +#' ) +#' +#' demo_svi( +#' area = "dc", +#' svi = "socioeconomic status" +#' ) #' } demo_svi <- function(area, svi) { - req <- create_request("demographics") - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype="county", - topic="svi", - demo=handle_svi(svi), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% + stateFIPS = fips_scp(area), + areatype = "county", + topic = "svi", + demo = handle_svi(svi), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% req_perform() - - + + resp <- process_response(resp) - - resp %>% + + resp %>% setNames(c("County", "FIPS", "Score")) } - diff --git a/R/demo-workforce.R b/R/demo-workforce.R index d2ee228..0a276e8 100644 --- a/R/demo-workforce.R +++ b/R/demo-workforce.R @@ -1,5 +1,5 @@ #' Access to Workforce Data -#' +#' #' This function returns a data frame from Workforce in State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. @@ -7,8 +7,8 @@ #' - `"county"` #' - `"hsa"` (Health Service Area) #' - `"state"`. -#' @param workforce The only permissible value is - #' `"unemployed"` +#' @param workforce The only permissible value is +#' `"unemployed"` #' @param race One of the following values: #' - `"All Races (includes Hispanic)"` #' - `"White (includes Hispanic)"` @@ -21,61 +21,77 @@ #' - `"both sexes"` #' - `"male"` #' - `"female"`. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, People Unemployed, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, People Unemployed, Rank. +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' demo_workforce(area = "WA", -#' areatype = "county", -#' workforce = "unemployed", -#' race = "all races (includes hispanic)", -#' sex = "both sexes") -#' -#' demo_workforce(area = "usa", -#' areatype = "state", -#' workforce = "unemployed", -#' race = "all races (includes hispanic)", -#' sex = "females") -#' -#' demo_workforce(area = "pr", -#' areatype = "hsa", -#' workforce = "unemployed", -#' race = "all races (includes hispanic)", -#' sex = "both sexes") +#' demo_workforce( +#' area = "WA", +#' areatype = "county", +#' workforce = "unemployed", +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) +#' +#' demo_workforce( +#' area = "usa", +#' areatype = "state", +#' workforce = "unemployed", +#' race = "all races (includes hispanic)", +#' sex = "females" +#' ) +#' +#' demo_workforce( +#' area = "pr", +#' areatype = "hsa", +#' workforce = "unemployed", +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) #' } demo_workforce <- function(area, areatype, workforce, race, sex) { - req <- create_request("demographics") - - resp <- req %>% + + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - topic="crowd", - demo=handle_workforce(workforce), - race=handle_race(race), - sex=handle_sex(sex), - type="manyareacensus", - sortVariableName="value", - sortOrder="default", - output=1 - ) %>% + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + topic = "crowd", + demo = handle_workforce(workforce), + race = handle_race(race), + sex = handle_sex(sex), + type = "manyareacensus", + sortVariableName = "value", + sortOrder = "default", + output = 1 + ) %>% req_perform() - + resp <- process_response(resp) - - areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") + + areatype_map <- c( + "county" = "County", + "hsa" = "Health_Service_Area", + "state" = "State" + ) areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Percent", "People Unemployed", "Rank")) + + resp %>% + setNames(c( + areatype_title, + areacode_title, + "Percent", + "People Unemployed", + "Rank" + )) } diff --git a/R/fips-scp.R b/R/fips-scp.R index 243b78f..d44039e 100644 --- a/R/fips-scp.R +++ b/R/fips-scp.R @@ -1,16 +1,17 @@ #' Process State to FIPS -#' +#' #' This function processes state names and abbreviations to FIPS data #' -#' @param area A state name or state abbreviation or United States of America or United States or usa or us -#' +#' @param area A state name or state abbreviation or +#' United States of America or United States or usa or us +#' #' @importFrom cdlTools fips #' @importFrom stringr str_pad -#' +#' #' @returns A string fips value or NA -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' fips_scp("pr") @@ -18,14 +19,13 @@ #' fips_scp("usa") #' } fips_scp <- function(area) { - - area = tolower(area) - - usa_list = c("united states", "united states of america", "us", "usa") - + area <- tolower(area) + + usa_list <- c("united states", "united states of america", "us", "usa") + if (area %in% usa_list) { return("00") } else { - str_pad(fips(area), width=2, side="left", pad="0") + str_pad(fips(area), width = 2, side = "left", pad = "0") } } diff --git a/R/global.R b/R/global.R index db064b3..06e6331 100644 --- a/R/global.R +++ b/R/global.R @@ -1 +1 @@ -utils::globalVariables(c("Value..Percent.", "Value..Dollars.")) \ No newline at end of file +utils::globalVariables(c("Value..Percent.", "Value..Dollars.")) diff --git a/R/handle-age.R b/R/handle-age.R index ab4a587..66ea72b 100644 --- a/R/handle-age.R +++ b/R/handle-age.R @@ -1,23 +1,30 @@ #' Handles Age Values to Code -#' -#' This function returns a matching code value for a Age for the api to use to get data from State Cancer Profiles #' -#' @param age Either "under 19 years", "18 to 64 years", "21 to 64 years", "40 to 64 years", "50 to 64 years", "under 65 years" -#' +#' This function returns a matching code value for a Age for the api +#' to use to get data from State Cancer Profiles +#' +#' @param age One of the following values: +#' - "under 19 years", +#' - "18 to 64 years", +#' - "21 to 64 years", +#' - "40 to 64 years", +#' - "50 to 64 years", +#' - "under 65 years" +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective age -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_age("under 19 years") #' handle_age(age) #' } handle_age <- function(age) { age <- tolower(age) - + age_mapping <- c( "under 19 years" = "175", "18 to 64 years" = "174", @@ -25,8 +32,8 @@ handle_age <- function(age) { "40 to 64 years" = "122", "50 to 64 years" = "141", "under 65 years" = "006", - - #cancer ages + + # cancer ages "all ages" = "001", "ages <50" = "009", "ages 50+" = "136", @@ -35,12 +42,12 @@ handle_age <- function(age) { "ages <15" = "016", "ages <20" = "015" ) - + age_code <- age_mapping[age] - + if (is_na(age_code)) { stop("Invalid age input, please check the documentation for valid inputs") } - + return(as.character(age_code)) } diff --git a/R/handle-alcohol.R b/R/handle-alcohol.R index 0b4140f..828bea1 100644 --- a/R/handle-alcohol.R +++ b/R/handle-alcohol.R @@ -1,32 +1,52 @@ #' Handles Alcohol Values to Code -#' -#' This function returns a matching code value for Alcohol for the api to use to get data from State Cancer Profiles #' -#' @param alcohol binge drinking (4+ drinks on one occasion for women, 5+ drinks for one occasion for men), ages 21+ -#' +#' This function returns a matching code value for Alcohol +#' for the api to use to get data from State Cancer Profiles +#' +#' @param alcohol +#' paste( +#' "binge drinking (4+ drinks on one occasion for women,", +#' "5+ drinks for one occasion for men), ages 21+" +#' ) +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Alcohol Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ -#' handle_alcohol(paste("binge drinking (4+ drinks on one occasion for women,", -#' "5+ drinks for one occasion for men), ages 21+")) +#' handle_alcohol(paste( +#' "binge drinking (4+ drinks on one occasion for women,", +#' "5+ drinks for one occasion for men), ages 21+" +#' )) #' } handle_alcohol <- function(alcohol) { alcohol <- tolower(alcohol) - + alcohol_mapping <- c( - "binge drinking (4+ drinks on one occasion for women, 5+ drinks for one occasion for men), ages 21+" = "v505" + paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + ) ) - + + alcohol_mapping[paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + )] <- "v505" + alcohol_code <- alcohol_mapping[alcohol] - + if (is_na(alcohol_code)) { - stop("Invalid alcohol input, please check the documentation for valid inputs") + stop( + paste( + "Invalid alcohol input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(alcohol_code)) } diff --git a/R/handle-cancer.R b/R/handle-cancer.R index 848af2d..a9f6e94 100644 --- a/R/handle-cancer.R +++ b/R/handle-cancer.R @@ -1,26 +1,46 @@ #' Handles Cancer Values to Code -#' -#' This function returns a matching code value for a Cancer for the api to use to get data from State Cancer Profiles #' -#' @param cancer Either "all cancer sites","bladder", "brain & ons", "breast (female)", "breast (female in situ)", "cervix", -#' "childhood (ages <15, all sites)", "childhood (ages <20, all sites)", "colon & rectum", "esophagus", -#' "kidney & renal pelvis", "leukemia", "liver & bile duct", "lung & bronchus", "melanoma of the skin", -#' "non-hodgkin lymphoma", "oral cavity & pharynx", "ovary", "pancreas", "prostate", "stomach", -#' "thyroid", "uterus (corpus & uterus, nos)" -#' +#' This function returns a matching code value for a Cancer for the +#' api to use to get data from State Cancer Profiles +#' +#' @param cancer One of the following values: +#' - `"all cancer sites"` +#' - `"bladder"` +#' - `"brain & ons"` +#' - `"breast (female)"` +#' - `"breast (female in situ)"` +#' - `"cervix"` +#' - `"childhood (ages <15, all sites)"` +#' - `"childhood (ages <20, all sites)"` +#' - `"colon & rectum"` +#' - `"esophagus"` +#' - `"kidney & renal pelvis"` +#' - `"leukemia"` +#' - `"liver & bile duct"` +#' - `"lung & bronchus"` +#' - `"melanoma of the skin"` +#' - `"non-hodgkin lymphoma"` +#' - `"oral cavity & pharynx"` +#' - `"ovary"` +#' - `"pancreas"` +#' - `"prostate"` +#' - `"stomach"` +#' - `"thyroid"` +#' - `"uterus (corpus & uterus, nos)"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective cancer type -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_cancer("bladder") #' } -handle_cancer <-function(cancer) { +handle_cancer <- function(cancer) { cancer <- tolower(cancer) - + cancer_mapping <- c( "all cancer sites" = "001", "bladder" = "071", @@ -46,12 +66,17 @@ handle_cancer <-function(cancer) { "thyroid" = "080", "uterus (corpus & uterus, nos)" = "058" ) - + cancer_code <- cancer_mapping[cancer] - + if (is_na(cancer_code)) { - stop("Invalid cancer input, please check the documentation for valid inputs") + stop( + paste( + "Invalid cancer input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(cancer_code)) } diff --git a/R/handle-crowding.R b/R/handle-crowding.R index bd73730..a12b916 100644 --- a/R/handle-crowding.R +++ b/R/handle-crowding.R @@ -1,31 +1,37 @@ #' Handles Crowding Values to Code -#' -#' This function returns a matching code value for Crowding for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for Crowding +#' for the api to use to get data from State Cancer Profiles #' #' @param crowding "household with >1 person per room" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Crowding Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_crowding("household with >1 person per room") #' } handle_crowding <- function(crowding) { crowding <- tolower(crowding) - + crowding_mapping <- c( "household with >1 person per room" = "00027" ) - + crowding_code <- crowding_mapping[crowding] - + if (is_na(crowding_code)) { - stop("Invalid crowding input, please check the documentation for valid inputs") + stop( + paste( + "Invalid crowding input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(crowding_code)) -} \ No newline at end of file +} diff --git a/R/handle-diet-exercise.R b/R/handle-diet-exercise.R index 62dbce7..2213339 100644 --- a/R/handle-diet-exercise.R +++ b/R/handle-diet-exercise.R @@ -1,26 +1,41 @@ #' Handles Diet & Exercise Values to Code -#' -#' This function returns a matching code value for a Diet & Exercise for the api to use to get data from State Cancer Profiles #' -#' @param diet_exercise Either "ever had colorectal endoscopy (sigmoidoscopy or colonoscopy), ages 50+", -#' "ever had fobt, ages 50-75", "fobt (1yr) / flex sig (5yr) / fobt (3yr) / colonoscopy (10yr), ages 50-75", -#' "guidance sufficient crc, ages 50-75", "had colonoscopy in past 10 years, ages 50-75", -#' "home-based fecal occult blood test (fobt) in past two years", -#' "home-based fobt in the past two years or ever had a colorectal endoscopy" -#' +#' This function returns a matching code value for a Diet & Exercise +#' for the api to use to get data from State Cancer Profiles +#' +#' @param diet_exercise One of the following values: +#' - `"bmi is healthy, ages 20+"` +#' - `"bmi is obese, ages 20+"` +#' - `"bmi is obese, high school survey"` +#' - `"bmi is overweight, high school survey"` +#' - `"consumed 1 or more fruits per day"` +#' - `"consumed 1 or more vegetables per day"` +#' - `"no leisure time physical activity"`. +#' @param race One of the following values: +#' - `"All Races (includes Hispanic)"` +#' - `"White (non-Hispanic)"` +#' - `"Black (non-Hispanic)"` +#' - `"American Indian / Alaska Native (non-Hispanic)"` +#' - `"Asian / Pacific Islander (non-Hispanic)"` +#' - `"Hispanic (Any Race)"`. +#' @param sex One of the following values: +#' - `"both sexes"` +#' - `"male"` +#' - `"female"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Diet & Exercise Value -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_diet_exercise("guidance sufficient crc, ages 50-75") #' } handle_diet_exercise <- function(diet_exercise) { diet_exercise <- tolower(diet_exercise) - + diet_exercise_mapping <- c( "bmi is healthy, ages 20+" = "v01", "bmi is obese, ages 20+" = "v02", @@ -30,12 +45,17 @@ handle_diet_exercise <- function(diet_exercise) { "consumed 1 or more vegetables per day" = "v51", "no leisure time physical activity" = "v18" ) - + diet_exercise_code <- diet_exercise_mapping[diet_exercise] - + if (is_na(diet_exercise_code)) { - stop("Invalid diet excerise input, please check the documentation for valid inputs") + stop( + paste( + "Invalid diet-exercise input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(diet_exercise_code)) } diff --git a/R/handle-education.R b/R/handle-education.R index 2756450..c8f6368 100644 --- a/R/handle-education.R +++ b/R/handle-education.R @@ -1,34 +1,42 @@ #' Handles Education Values to Code -#' -#' This function returns a matching code value for a Education for the api to use to get data from State Cancer Profiles #' -#' @param education Either "less than 9th grade", "at least high school", "at least bachelors degree" -#' +#' This function returns a matching code value for a Education +#' for the api to use to get data from State Cancer Profiles +#' +#' @param education One of the following values: +#' - "less than 9th grade" +#' - "at least high school" +#' - "at least bachelors degree". +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective education -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_education("at least bachelors degree") #' } -handle_education <-function(education) { +handle_education <- function(education) { education <- tolower(education) - + edu_mapping <- c( "less than 9th grade" = "00004", "at least high school" = "00109", "at least bachelors degree" = "00006" ) - + edu_code <- edu_mapping[education] - + if (is_na(edu_code)) { - stop("Invalid education input, please check the documentation for valid inputs") + stop( + paste( + "Invalid education input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(edu_code)) } - diff --git a/R/handle-food.R b/R/handle-food.R index 86ea6d9..8c655d8 100644 --- a/R/handle-food.R +++ b/R/handle-food.R @@ -1,32 +1,33 @@ #' Handles Food Values to Code -#' -#' This function returns a matching code value for a Food for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for a Food +#' for the api to use to get data from State Cancer Profiles #' #' @param food Either "food insecurity" or "limited access to healthy food" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective food -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_food("limited access to healthy food") #' } handle_food <- function(food) { food <- tolower(food) - + food_mapping <- c( "food insecurity" = "03003", "limited access to healthy food" = "03004" ) - + food_code <- food_mapping[food] - + if (is_na(food_code)) { stop("Invalid food input, please check the documentation for valid inputs") } - + return(as.character(food_code)) } diff --git a/R/handle-income.R b/R/handle-income.R index a8f1001..ffa61fb 100644 --- a/R/handle-income.R +++ b/R/handle-income.R @@ -1,32 +1,38 @@ #' Handles Income Values to Code -#' -#' This function returns a matching code value for a Income for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for a Income +#' for the api to use to get data from State Cancer Profiles #' #' @param income Either "median family income" or "median household income" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective income -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_income("median family income") #' } handle_income <- function(income) { income <- tolower(income) - + income_mapping <- c( "median family income" = "00010", "median household income" = "00011" ) - + income_code <- income_mapping[income] - + if (is_na(income_code)) { - stop("Invalid income input, please check the documentation for valid inputs") + stop( + paste( + "Invalid income input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(income_code)) } diff --git a/R/handle-insurance.R b/R/handle-insurance.R index b31cf96..25f5efc 100644 --- a/R/handle-insurance.R +++ b/R/handle-insurance.R @@ -1,34 +1,35 @@ #' Handles Insurance Values to Code -#' -#' This function returns a matching code value for a insurance value for the api to use to get data from State Cancer Profiles #' -#' @param insurance Either "% insured in demographic group, all income levels" = "00030", -#' "% insured in demographic group, people at or below 138% of poverty", -#' "% insured in demographic group, people at or below 200% of poverty", -#' "% insured in demographic group, people at or below 250% of poverty", -#' "% insured in demographic group, people at or below 400% of poverty", -#' "% insured in demographic group, people between 138% - 400% of poverty", -#' "% uninsured in demographic group, all income levels", -#' "% uninsured in demographic group, people at or below 138% of poverty", -#' "% uninsured in demographic group, people at or below 200% of poverty", -#' "% uninsured in demographic group, people at or below 250% of poverty", -#' "% uninsured in demographic group, people at or below 400% of poverty", -#' "% uninsured in demographic group, people between 138% - 400% of poverty" -#' +#' This function returns a matching code value for a insurance value +#' for the api to use to get data from State Cancer Profiles +#' +#' @param insurance One of the following values: +#' - `"% Insured in demographic group, all income levels"` +#' - `"% Insured in demographic group, people at or below 138% of Poverty"` +#' - `"% Insured in demographic group, people at or below 200% of Poverty"` +#' - `"% Insured in demographic group, people at or below 250% of Poverty"` +#' - `"% Insured in demographic group, people at or below 400% of Poverty"` +#' - `"% Insured in demographic group, people between 138% - 400% of poverty"` +#' - `"% uninsured in demographic group, all income levels"` +#' - `"% uninsured in demographic group, people at or below 138% of Poverty"` +#' - `"% uninsured in demographic group, people at or below 200% of Poverty"` +#' - `"% uninsured in demographic group, people at or below 250% of Poverty"` +#' - `"% uninsured in demographic group, people at or below 400% of Poverty"` +#' - `"% uninsured in demographic group, people between 138% - 400% of poverty"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective insurance -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_insurance("% insured in demographic group, all income levels") #' } handle_insurance <- function(insurance) { - insurance <- tolower(insurance) - + insurance_mapping <- c( "% insured in demographic group, all income levels" = "00030", "% insured in demographic group, people at or below 138% of poverty" = "00033", @@ -43,12 +44,17 @@ handle_insurance <- function(insurance) { "% uninsured in demographic group, people at or below 400% of poverty" = "00044", "% uninsured in demographic group, people between 138% - 400% of poverty" = "00045" ) - + insurance_code <- insurance_mapping[insurance] - + if (is_na(insurance_code)) { - stop("Invalid insurance input, please check the documentation for valid inputs") + stop( + paste( + "Invalid insurance input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(insurance_code)) } diff --git a/R/handle-mobility.R b/R/handle-mobility.R index 3d0a5aa..e09386f 100644 --- a/R/handle-mobility.R +++ b/R/handle-mobility.R @@ -1,38 +1,46 @@ #' Handles Mobility Values to Code -#' -#' This function returns a matching code value for a mobility for the api to use to get data from State Cancer Profiles #' -#' @param mobility Either "i haven't moved (in past year)", "moved from outside us (in past year)", -#' "moved, different state (in past year)", "moved, different county, same state (in past year)", -#' "moved, same county (in past year)" -#' +#' This function returns a matching code value for a mobility +#' for the api to use to get data from State Cancer Profiles +#' +#' @param mobility The only permissible values are +#' - `"i haven't moved (in past year)"` +#' - `"moved from outside us (in past year)"` +#' - `"moved, different state (in past year)"` +#' - `"moved, different county, same state (in past year)"` +#' - `"moved, same county (in past year)"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective mobility -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_mobility("i haven't moved (in past year)") #' } -handle_mobility <-function(mobility) { - +handle_mobility <- function(mobility) { mobility <- tolower(mobility) - - mobility_mapping <- c( + + mobility_mapping <- c( "i haven't moved (in past year)" = "00017", "moved from outside us (in past year)" = "00021", "moved, different state (in past year)" = "00020", "moved, different county, same state (in past year)" = "00019", "moved, same county (in past year)" = "00018" ) - + mobility_code <- mobility_mapping[mobility] - + if (is_na(mobility_code)) { - stop("Invalid mobility input, please check the documentation for valid inputs") + stop( + paste( + "Invalid mobility input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(mobility_code)) } diff --git a/R/handle-non-english.R b/R/handle-non-english.R index c73ec5f..404423a 100644 --- a/R/handle-non-english.R +++ b/R/handle-non-english.R @@ -1,31 +1,37 @@ #' Handles Non-English Language Values to Code -#' -#' This function returns a matching code value for Non-English Language for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for Non-English Language +#' for the api to use to get data from State Cancer Profiles #' #' @param language "language isolation" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective language Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_non_english("language isolation") #' } handle_non_english <- function(language) { language <- tolower(language) - + language_mapping <- c( "language isolation" = "00015" ) - + language_code <- language_mapping[language] - + if (is_na(language_code)) { - stop("Invalid language input, please check the documentation for valid inputs") + stop( + paste( + "Invalid language input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(language_code)) -} \ No newline at end of file +} diff --git a/R/handle-population.R b/R/handle-population.R index db460f3..2227a38 100644 --- a/R/handle-population.R +++ b/R/handle-population.R @@ -1,28 +1,38 @@ #' Handles population Values to Code -#' -#' This function returns a matching code value for a population for the api to use to get data from State Cancer Profiles #' -#' @param population One of the following values: -#' "age under 18", "age 18-39", age 40-64", "ages 40 and over", "ages 50 and over", "ages 60 and over", -#' "american indian/alaska native", "asian/pacific islander", "black", "foreign born", -#' "hispanic", "non-hispanic (origin recode)","white", -#' -#' "males", "females" -#' +#' This function returns a matching code value for a population +#' for the api to use to get data from State Cancer Profiles +#' +#' @param population One of the following values: +#' - `"age under 18"` +#' - `"age 18-39"` +#' - `"age 40-64"` +#' - `"ages 40 and over"` +#' - `"ages 50 and over"` +#' - `"ages 60 and over"` +#' - `"american indian/alaska native"` +#' - `"asian/pacific islander"` +#' - `"black"` +#' - `"foreign born"` +#' - `"hispanic"` +#' - `"non-hispanic (origin recode)"` +#' - `"white"` +#' - `"males"` +#' - `"females"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective population -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_population("males") #' } handle_population <- function(population) { - population <- tolower(population) - + population_mapping <- c( "age under 18" = "00002", "age 18-39" = "00102", @@ -30,7 +40,6 @@ handle_population <- function(population) { "ages 40 and over" = "00028", "ages 50 and over" = "00029", "ages 60 and over" = "00003", - "american indian/alaska native" = "00023", "asian/pacific islander" = "00024", "black" = "00022", @@ -38,16 +47,20 @@ handle_population <- function(population) { "hispanic" = "00026", "non-hispanic (origin recode)" = "00101", "white" = "00025", - "males" = "00104", "females" = "00105" ) - + population_code <- population_mapping[population] - + if (is_na(population_code)) { - stop("Invalid population input, please check the documentation for valid inputs") + stop( + paste( + "Invalid population input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(population_code)) } diff --git a/R/handle-poverty.R b/R/handle-poverty.R index 24bf0ec..f826620 100644 --- a/R/handle-poverty.R +++ b/R/handle-poverty.R @@ -1,36 +1,44 @@ #' Handles Poverty Values to Code -#' -#' This function returns a matching code value for a Poverty for the api to use to get data from State Cancer Profiles #' -#' @param poverty One of the following values: -#' "families below poverty", "persistent poverty", "persons below poverty", "persons < 150% of poverty -#' +#' This function returns a matching code value for a Poverty +#' for the api to use to get data from State Cancer Profiles +#' +#' @param poverty One of the following values: +#' - `"families below poverty"` +#' - `"persistent poverty"` +#' - `"persons below poverty"` +#' - `"persons < 150% of poverty"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective poverty variable -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_poverty("families below poverty") #' } handle_poverty <- function(poverty) { - poverty <- tolower(poverty) - + poverty_mapping <- c( "families below poverty" = "00007", "persistent poverty" = "03001", "persons below poverty" = "00008", "persons < 150% of poverty" = "00009" ) - + poverty_code <- poverty_mapping[poverty] - + if (is_na(poverty_code)) { - stop("Invalid poverty input, please check the documentation for valid inputs") + stop( + paste( + "Invalid poverty input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(poverty_code)) } diff --git a/R/handle-race.R b/R/handle-race.R index ea0d5e9..a82119c 100644 --- a/R/handle-race.R +++ b/R/handle-race.R @@ -1,28 +1,42 @@ #' Handles Race Values to Code -#' -#' This function returns a matching code value for a race for the api to use to get data from State Cancer Profiles #' -#' @param race One of the following values: "All Races (includes Hispanic)", "white (includes hispanic)" = "01", -#' "white non-hispanic","black","black (includes hispanic)", "amer. indian/alaskan native (includes hispanic)", -#' "asian or pacific islander (includes hispanic)","hispanic (any race) -#' +#' This function returns a matching code value for a race +#' for the api to use to get data from State Cancer Profiles +#' +#' @param race One of the following values: +#' - "all races (includes hispanic)" +#' - "white (includes hispanic)" +#' - "white non-hispanic" +#' - "black" +#' - "black (includes hispanic)" +#' - "amer. indian/alaskan native (includes hispanic)" +#' - "american indian/alaska native" +#' - "asian or pacific islander (includes hispanic)" +#' - "asian/pacific islander" +#' - "hispanic (any race)" +#' - "white (non-hispanic)" +#' - "black (non-hispanic)" +#' - "amer. indian / ak native (non-hispanic)" +#' - "american indian / alaska native (non-hispanic)" +#' - "asian / pacific islander (non-hispanic)" +#' - "asian (non-hispanic)" +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective race -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_race("all races (includes hispanic)") #' handle_race("black (non-hispanic)") #' } handle_race <- function(race) { - race <- tolower(race) - + race_mapping <- c( - #demographic + # demographic "all races (includes hispanic)" = "00", "white (includes hispanic)" = "01", "white non-hispanic" = "07", @@ -33,22 +47,21 @@ handle_race <- function(race) { "asian or pacific islander (includes hispanic)" = "04", "asian/pacific islander" = "04", "hispanic (any race)" = "05", - - #screening and risk factors + + # screening and risk factors "white (non-hispanic)" = "07", "black (non-hispanic)" = "28", "amer. indian / ak native (non-hispanic)" = "38", "american indian / alaska native (non-hispanic)" = "38", "asian / pacific islander (non-hispanic)" = "48", "asian (non-hispanic)" = "49" - ) - + code <- race_mapping[race] - + if (is_na(code)) { stop("Invalid race input, please check the documentation for valid inputs") } - + return(as.character(code)) } diff --git a/R/handle-risk-datatype.R b/R/handle-risk-datatype.R index 14511b1..ae83246 100644 --- a/R/handle-risk-datatype.R +++ b/R/handle-risk-datatype.R @@ -1,32 +1,38 @@ #' Handles Risk Data Types to Code -#' -#' This function returns a matching code value for a Risk Data Types for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for a Risk Data Types +#' for the api to use to get data from State Cancer Profiles #' #' @param datatype Either "direct estimates" or "county level modeled estimates" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Risk Data Types Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_datatype("direct estimates") #' } handle_datatype <- function(datatype) { datatype <- tolower(datatype) - + datatype_mapping <- c( "direct estimates" = "0", "county level modeled estimates" = "1" ) - + datatype_code <- datatype_mapping[datatype] - + if (is_na(datatype_code)) { - stop("Invalid datatype input, please check the documentation for valid inputs") + stop( + paste( + "Invalid datatype input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(datatype_code)) } diff --git a/R/handle-screening.R b/R/handle-screening.R index 1fdb721..46e54f3 100644 --- a/R/handle-screening.R +++ b/R/handle-screening.R @@ -1,46 +1,46 @@ #' Handles Colorectal Screening Values to Code -#' -#' This function returns a matching code value for a Colorectal Screening for the api to use to get data from State Cancer Profiles #' -#' @param screening Either "ever had colorectal endoscopy (sigmoidoscopy or colonoscopy), ages 50+", -#' "ever had fobt, ages 50-75", "fobt (1yr) / flex sig (5yr) / fobt (3yr) / colonoscopy (10yr), ages 50-75", -#' "guidance sufficient crc, ages 50-75", "had colonoscopy in past 10 years, ages 50-75", -#' "home-based fecal occult blood test (fobt) in past two years", -#' "home-based fobt in the past two years or ever had a colorectal endoscopy" -#' +#' This function returns a matching code value for a Colorectal Screening +#' for the api to use to get data from State Cancer Profiles +#' +#' @param screening One of the following values: +#' - `"ever had fobt, ages 50-75"` +#' - `"guidance sufficient crc, ages 50-75"` +#' - `"had colonoscopy in past 10 years, ages 50-75"` +#' - `"home blood stool test in the past year, ages 45-75"` +#' - `"received at least one recommended crc test, ages 45-75"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Colorectal Screening Value -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_screening("guidance sufficient crc, ages 50-75") #' } handle_screening <- function(screening) { screening <- tolower(screening) - + screening_mapping <- c( "ever had fobt, ages 50-75" = "v304", "guidance sufficient crc, ages 50-75" = "v303", "had colonoscopy in past 10 years, ages 50-75" = "v302", - "home blood stool test in the past year, ages 45-75" = "v520", "received at least one recommended crc test, ages 45-75" = "v521" - - #removed from scp - # "ever had colorectal endoscopy (sigmoidoscopy or colonoscopy), ages 50+" = "v09", - # "fobt (1yr) / flex sig (5yr) / fobt (3yr) / colonoscopy (10yr), ages 50-75" = "v14", - # "home-based fecal occult blood test (fobt) in past two years" = "v13", - # "home-based fobt in the past two years or ever had a colorectal endoscopy" = "v59" ) - + screening_code <- screening_mapping[screening] - + if (is_na(screening_code)) { - stop("Invalid screening input, please check the documentation for valid inputs") + stop( + paste( + "Invalid screening input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(screening_code)) } diff --git a/R/handle-sex.R b/R/handle-sex.R index 37d9eab..d59b451 100644 --- a/R/handle-sex.R +++ b/R/handle-sex.R @@ -1,33 +1,34 @@ #' Handles Sex Values to Code -#' -#' This function returns a matching code value for a sex for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for a sex +#' for the api to use to get data from State Cancer Profiles #' #' @param sex Either "both sexes", "males", "females" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective sex -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_sex("both sexes") #' } handle_sex <- function(sex) { sex <- tolower(sex) - - sex_mapping <- c( + + sex_mapping <- c( "both sexes" = "0", "males" = "1", "females" = "2" ) - + sex_code <- sex_mapping[sex] - + if (is_na(sex_code)) { stop("Invalid sex input, please check the documentation for valid inputs") } - + return(as.character(sex_code)) } diff --git a/R/handle-smoking.R b/R/handle-smoking.R index 9497f66..17cc2cb 100644 --- a/R/handle-smoking.R +++ b/R/handle-smoking.R @@ -1,54 +1,70 @@ #' Handles Smoking Values to Code -#' -#' This function returns a matching code value for a Smoking for the api to use to get data from State Cancer Profiles #' -#' @param smoking Either "mammogram in past 2 years, ages 50-74", "mammogram in past 2 years, ages 40+", -#' "pap smear in past 3 years, no hysterectomy, ages 21-65", -#' "pap smear in past 3 years, no hysterectomy, ages 18+" -#' +#' This function returns a matching code value for smoking +#' for the api to use to get data from State Cancer Profiles. +#' +#' @param smoking The only permissible values are +#' - `"smoking laws (any)"` +#' - `"smoking laws (bars)"` +#' - `"smoking laws (restaurants)"` +#' - `"smoking laws (workplace)"` +#' - `"smoking laws (workplace; restaurant; & bar)"` +#' - `"smokers (stopped for 1 day or longer)"` +#' - `"smoking not allowed at work (all people)"` +#' - `"smoking not allowed in home (all people)"` +#' - `"smoking not allowed at work (current smokers)"` +#' - `"smoking not allowed at work (former/never smokers)"` +#' - `"smoking not allowed in home (current smokers)"` +#' - `"smoking not allowed in home (former/never smokers)"` +#' - `"former smoker; ages 18+"` +#' - `"former smoker, quit 1 year+; ages 18+"` +#' - `"smokers (ever); ages 18+"` +#' - `"e-cigarette use; ages 18+"` +#' - `"smokers (current); ages 18+"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Smoking Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_smoking("former smoker, quit 1 year+; ages 18+") #' } handle_smoking <- function(smoking) { smoking <- tolower(smoking) - + smoking_mapping <- c( "smokers (current); ages 18+" = "v19", - "smokers (ever); ages 18+" = "v28", "e-cigarette use; ages 18+" = "v37", - "former smoker; ages 18+" = "v300", "former smoker, quit 1 year+; ages 18+" = "v301", - "smoking not allowed at work (current smokers)" = "v32", - "smoking not allowed at work (former/never smokers)" = "v33", + "smoking not allowed at work (former/never smokers)" = "v33", "smoking not allowed in home (current smokers)" = "v35", "smoking not allowed in home (former/never smokers)" = "v36", - "smokers (stopped for 1 day or longer)" = "v30", "smoking not allowed at work (all people)" = "v31", "smoking not allowed in home (all people)" = "v34", - "smoking laws (any)" = "v44", "smoking laws (bars)" = "v42", "smoking laws (restaurants)" = "v41", "smoking laws (workplace)" = "v40", "smoking laws (workplace; restaurant; & bar)" = "43" ) - + smoking_code <- smoking_mapping[smoking] - + if (is_na(smoking_code)) { - stop("Invalid smoking input, please check the documentation for valid inputs") + stop( + paste( + "Invalid smoking input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(smoking_code)) } diff --git a/R/handle-stage.R b/R/handle-stage.R index 2d790ce..4257f68 100644 --- a/R/handle-stage.R +++ b/R/handle-stage.R @@ -1,32 +1,33 @@ #' Handles Cancer Stage Values to Code -#' -#' This function returns a matching code value for a Cancer Stage for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for a Cancer Stage +#' for the api to use to get data from State Cancer Profiles #' #' @param stage Either "all stages" or "late stage (regional & distant)" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Cancer Stage -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_stage("all stages") #' } -handle_stage <-function(stage) { +handle_stage <- function(stage) { stage <- tolower(stage) - + stage_mapping <- c( "all stages" = "999", "late stage (regional & distant)" = "211" ) - + stage_code <- stage_mapping[stage] - + if (is_na(stage_code)) { stop("Invalid stage input, please check the documentation for valid inputs") } - + return(as.character(stage_code)) } diff --git a/R/handle-svi.R b/R/handle-svi.R index bd326e3..36a9c78 100644 --- a/R/handle-svi.R +++ b/R/handle-svi.R @@ -1,24 +1,28 @@ #' Handles Social Vulnerability Index (SVI) Values to Code -#' -#' This function returns a matching code value for a SVI for the api to use to get data from State Cancer Profiles #' -#' @param svi One of the following values: -#' "overall", "socioeconomic status", "household characteristics", -#' "racial & ethinic minority status", "housing type & transportation" -#' +#' This function returns a matching code value for a SVI +#' for the api to use to get data from State Cancer Profiles +#' +#' @param svi One of the following values: +#' - `"Overall"` +#' - `"socioeconomic status"` +#' - `"household characteristics"` +#' - `"racial & ethinic minority status"` +#' - `"housing type & transportation"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective SVI variable -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_svi("overall") #' } handle_svi <- function(svi) { svi <- tolower(svi) - + svi_mapping <- c( "overall" = "03010", "socioeconomic status" = "03011", @@ -26,12 +30,12 @@ handle_svi <- function(svi) { "racial & ethinic minority status" = "03013", "housing type & transportation" = "03014" ) - + svi_code <- svi_mapping[svi] - + if (is_na(svi_code)) { stop("Invalid svi input, please check the documentation for valid inputs") } - + return(as.character(svi_code)) } diff --git a/R/handle-vaccine.R b/R/handle-vaccine.R index 9b192a1..f442129 100644 --- a/R/handle-vaccine.R +++ b/R/handle-vaccine.R @@ -1,39 +1,39 @@ #' Handles Vaccines Values to Code -#' -#' This function returns a matching code value for a Vaccines for the api to use to get data from State Cancer Profiles #' -#' @param vaccine Either "mammogram in past 2 years, ages 50-74", "mammogram in past 2 years, ages 40+", -#' "pap smear in past 3 years, no hysterectomy, ages 21-65", -#' "pap smear in past 3 years, no hysterectomy, ages 18+" -#' +#' This function returns a matching code value for a Vaccines +#' for the api to use to get data from State Cancer Profiles +#' +#' @param vaccine One of the following values: +#' - `"percent with up to date hpv vaccination coverage, ages 13-15",` +#' - `"percent with up to date hpv vaccination coverage, ages 13-17"`. +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Vaccine Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_vaccine("percent who received 2+ doses of HPV vaccine, ages 13-17") #' } handle_vaccine <- function(vaccine) { vaccine <- tolower(vaccine) - + vaccine_mapping <- c( - # removed from scp - # "percent who received 2+ doses of hpv vaccine, ages 13-15" = "v90", - # "percent who received 2+ doses of hpv vaccine, ages 13-17" = "v91", - # "percent who received 3+ doses of hpv vaccine, ages 13-15" = "v70", - # "percent who received 3+ doses of hpv vaccine, ages 13-17" = "v71" - "percent with up to date hpv vaccination coverage, ages 13-15" = "v281", "percent with up to date hpv vaccination coverage, ages 13-17" = "v282" ) - + vaccine_code <- vaccine_mapping[vaccine] - + if (is_na(vaccine_code)) { - stop("Invalid vaccine input, please check the documentation for valid inputs") + stop( + paste( + "Invalid vaccine input, please check", + "the documentation for valid inputs" + ) + ) } return(as.character(vaccine_code)) } diff --git a/R/handle-women_health.R b/R/handle-women_health.R index f48ede8..f00e64b 100644 --- a/R/handle-women_health.R +++ b/R/handle-women_health.R @@ -1,39 +1,43 @@ #' Handles Women's Health Values to Code -#' -#' This function returns a matching code value for a Women's Health for the api to use to get data from State Cancer Profiles #' -#' @param women_health Either "mammogram in past 2 years, ages 50-74", "mammogram in past 2 years, ages 40+", -#' "pap smear in past 3 years, no hysterectomy, ages 21-65", -#' "pap smear in past 3 years, no hysterectomy, ages 18+" -#' +#' This function returns a matching code value for a Women's Health +#' for the api to use to get data from State Cancer Profiles +#' +#' @param women_health One of the following values: +#' - `"mammogram in past 2 years, ages 50-74"` +#' - `"mammogram in past 2 years, ages 40+"` +#' - `"pap smear in past 3 years, no hysterectomy, ages 21-65"`. +#' +#' #' -#' #' @returns A string for its respective Women's Health Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_whealth("mammogram in past 2 years, ages 50-74") #' } handle_women_health <- function(women_health) { women_health <- tolower(women_health) - + whealth_mapping <- c( "mammogram in past 2 years, ages 50-74" = "v05", "mammogram in past 2 years, ages 40+" = "v06", "pap smear in past 3 years, no hysterectomy, ages 21-65" = "v17", "pap smear in past 3 years, no hysteroetomy, ages 21-65" = "v17" - - #removed from scp - # "pap smear in past 3 years, no hysterectomy, ages 18+" = "v11" ) - + whealth_code <- whealth_mapping[women_health] - + if (is.na(whealth_code)) { - stop("Invalid womens health input, please check the documentation for valid inputs") + stop( + paste( + "Invalid womens health input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(whealth_code)) } diff --git a/R/handle-workforce.R b/R/handle-workforce.R index a4587d6..e340eb9 100644 --- a/R/handle-workforce.R +++ b/R/handle-workforce.R @@ -1,31 +1,37 @@ #' Handles workforce Values to Code -#' -#' This function returns a matching code value for workforce for the api to use to get data from State Cancer Profiles +#' +#' This function returns a matching code value for workforce +#' for the api to use to get data from State Cancer Profiles #' #' @param workforce "unemployed" -#' +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective workforce Value -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' handle_workforce("unemployed") #' } handle_workforce <- function(workforce) { workforce <- tolower(workforce) - + workforce_mapping <- c( "unemployed" = "00012" ) - + workforce_code <- workforce_mapping[workforce] - + if (is_na(workforce_code)) { - stop("Invalid workforce input, please check the documentation for valid inputs") + stop( + paste( + "Invalid workforce input, please check", + "the documentation for valid inputs" + ) + ) } - + return(as.character(workforce_code)) -} \ No newline at end of file +} diff --git a/R/handle-year.R b/R/handle-year.R index 464113c..b6c0ae5 100644 --- a/R/handle-year.R +++ b/R/handle-year.R @@ -1,32 +1,35 @@ #' Handles Cancer Incidence Year Values to Code -#' -#' This function returns a matching code value for a Cancer Incidence Year for the api to use to get data from State Cancer Profiles #' -#' @param year Either "latest 5 year average", "latest single year (us by state)" -#' +#' This function returns a matching code value for a Cancer Incidence Year +#' for the api to use to get data from State Cancer Profiles +#' +#' @param year One of the following values: +#' - "latest 5 year average", +#' - "latest single year (us by state)" +#' #' @importFrom rlang is_na -#' +#' #' @returns A string for its respective Cancer Incidence Year -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' handle_year("latest 5 year average") #' } -handle_year <-function(year) { +handle_year <- function(year) { year <- tolower(year) - + year_mapping <- c( "latest 5 year average" = "0", "latest single year (us by state)" = "1" ) - + year_code <- year_mapping[year] - + if (is_na(year_code)) { stop("Invalid year input, please check the documentation for valid inputs") } - + return(as.character(year_code)) } diff --git a/R/incidence-cancer.R b/R/incidence-cancer.R index 9465a13..3922b89 100644 --- a/R/incidence-cancer.R +++ b/R/incidence-cancer.R @@ -1,5 +1,5 @@ #' Access to Cancer Incident Data -#' +#' #' This function returns a data frame about cancer incidence from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. @@ -56,93 +56,100 @@ #' @param year One of the following values: #' - `"latest 5 year average"` #' - `"latest single year (us by state)"`. -#' +#' #' @returns A data frame with the following columns: Area Type, Area Code, Age Adjusted Incidence Rate, Lower 95% CI, -#' Upper 95% CI, CI Rank, Lower CI Rank, Upper CI Rank, Annual Average Count, Recent Trend, +#' Upper 95% CI, CI Rank, Lower CI Rank, Upper CI Rank, Annual Average Count, Recent Trend, #' Recent 5 Year Trend, Trend Lower 95% CI, Trend Upper 95% CI. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' incidence_cancer(area = "wa", -#' areatype = "county", -#' cancer = "all cancer sites", -#' race = "black (non-hispanic)", -#' sex = "both sexes", -#' age = "ages 65+", -#' stage = "all stages", -#' year = "latest 5 year average") -#' -#' incidence_cancer(area = "usa", -#' areatype = "state", -#' cancer = "lung & bronchus", -#' race = "all races (includes hispanic)", -#' sex = "males", -#' age = "ages 50+", -#' stage = "late stage (regional & distant)", -#' year = "latest single year (us by state)") -#' -#' incidence_cancer(area = "wa", -#' areatype = "hsa", -#' cancer = "ovary", -#' race = "all races (includes hispanic)", -#' sex = "females", -#' age = "ages 50+", -#' stage = "late stage (regional & distant)", -#' year = "latest 5 year average") +#' incidence_cancer( +#' area = "wa", +#' areatype = "county", +#' cancer = "all cancer sites", +#' race = "black (non-hispanic)", +#' sex = "both sexes", +#' age = "ages 65+", +#' stage = "all stages", +#' year = "latest 5 year average" +#' ) +#' +#' incidence_cancer( +#' area = "usa", +#' areatype = "state", +#' cancer = "lung & bronchus", +#' race = "all races (includes hispanic)", +#' sex = "males", +#' age = "ages 50+", +#' stage = "late stage (regional & distant)", +#' year = "latest single year (us by state)" +#' ) +#' +#' incidence_cancer( +#' area = "wa", +#' areatype = "hsa", +#' cancer = "ovary", +#' race = "all races (includes hispanic)", +#' sex = "females", +#' age = "ages 50+", +#' stage = "late stage (regional & distant)", +#' year = "latest 5 year average" +#' ) #' } incidence_cancer <- function(area, areatype, cancer, race, sex, age, stage, year) { - - allstage_cancer <- c("all cancer sites", "breast (female in situ)", "childhood (ages <15, all sites)", - "childhood (ages <20, all sites)", "leukemia") - + allstage_cancer <- c( + "all cancer sites", "breast (female in situ)", "childhood (ages <15, all sites)", + "childhood (ages <20, all sites)", "leukemia" + ) + female_cancer <- c("breast (female)", "breast (female in situ)", "ovary", "uterus (corpus & uterus, nos)") - + childhood_cancer <- c("childhood (ages <15, all sites)", "childhood (ages <20, all sites)") - + if ((areatype == "county" || areatype == "hsa") && year == "latest single year (us by state)") { cli_abort("For year latest single year (us by state), areatype must be state") } - + if ((cancer %in% allstage_cancer) && stage == "late stage (regional & distant)") { cli_abort("For this cancer type, stage must be all stages") } - + if ((cancer %in% female_cancer) && (sex == "males" || sex == "both sexes")) { cli_abort("For this cancer type, sex must be females") } else if (cancer == "prostate" && (sex == "females" || sex == "both sexes")) { cli_abort("For prostate cancer, sex must be males.") } - + if (cancer == "childhood (ages <15, all sites)" && age != "ages <15") { cli_abort("For childhood (ages <15, all sites), age must be ages <15") - } else if (cancer == "childhood (ages <20, all sites)" && age !="ages <20") { + } else if (cancer == "childhood (ages <20, all sites)" && age != "ages <20") { cli_abort("For childhood (ages <20, all sites), age must be ages <20") } else if ((!cancer %in% childhood_cancer) && (age == "ages <15" || age == "ages <20")) { cli_abort("For this cancer type, age cannot be ages <15 or ages <20") } - + req <- create_request("incidencerates") - + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - cancer=handle_cancer(cancer), - race=handle_race(race), - age=handle_age(age), - stage=handle_stage(stage), - year=handle_year(year), - type="incd", - sortVariableName="rate", - sortOrder="default", - output=1 + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + cancer = handle_cancer(cancer), + race = handle_race(race), + age = handle_age(age), + stage = handle_stage(stage), + year = handle_year(year), + type = "incd", + sortVariableName = "rate", + sortOrder = "default", + output = 1 ) - - if(!is.null(sex)) { + + if (!is.null(sex)) { resp <- resp %>% - req_url_query(sex=handle_sex(sex)) + req_url_query(sex = handle_sex(sex)) } resp <- resp %>% @@ -153,7 +160,7 @@ incidence_cancer <- function(area, areatype, cancer, race, sex, age, stage, year areatype_map <- c("county" = "County", "hsa" = "Health Service Area", "state" = "State") areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] diff --git a/R/mortality-cancer.R b/R/mortality-cancer.R index a3328c6..04dcdac 100644 --- a/R/mortality-cancer.R +++ b/R/mortality-cancer.R @@ -1,5 +1,5 @@ #' Access to Cancer Mortality Data -#' +#' #' This function returns a data frame about cancer mortality from State Cancer Profiles. #' #' @param area A state/territory abbreviation or USA. @@ -7,7 +7,7 @@ #' - `"county"` #' - `"hsa"` (Health Service Area) #' - `"state"`. -#' @param cancer One of the following values: +#' @param cancer One of the following values: #' `"all cancer sites"` #' `"bladder", "brain & ons"` #' `"breast (female)"` @@ -51,97 +51,105 @@ #' @param year One of the following values: #' - `"latest 5 year average"` #' - `"latest single year (us by state)"`. -#' +#' #' @returns A data frame with the following columns: Area Type, Area Code, Met Healthy People Objective of ***?, -#' Age Adjusted Death Rate, Lower 95% CI Rate, Upper 95% CI Rate, -#' CI Rank, Lower CI Rank, Upper CI Rank, Annual Average Count, +#' Age Adjusted Death Rate, Lower 95% CI Rate, Upper 95% CI Rate, +#' CI Rank, Lower CI Rank, Upper CI Rank, Annual Average Count, #' Recent Trend, Recent 5 Year Trend, Lower 95% CI Trend, Upper 95% CI Trend. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' mortality_cancer(area = "wa", -#' areatype = "county", -#' cancer = "all cancer sites", -#' race = "black (non-hispanic)", -#' sex = "both sexes", -#' age = "ages 65+", -#' year = "latest 5 year average") +#' mortality_cancer( +#' area = "wa", +#' areatype = "county", +#' cancer = "all cancer sites", +#' race = "black (non-hispanic)", +#' sex = "both sexes", +#' age = "ages 65+", +#' year = "latest 5 year average" +#' ) +#' +#' mortality_cancer( +#' area = "usa", +#' areatype = "state", +#' cancer = "prostate", +#' race = "all races (includes hispanic)", +#' sex = "males", +#' age = "ages 50+", +#' year = "latest single year (us by state)" +#' ) #' -#' mortality_cancer(area = "usa", -#' areatype = "state", -#' cancer = "prostate", -#' race = "all races (includes hispanic)", -#' sex = "males", -#' age = "ages 50+", -#' year = "latest single year (us by state)") -#' -#' mortality_cancer(area = "wa", -#' areatype = "hsa", -#' cancer = "ovary", -#' race = "all races (includes hispanic)", -#' sex = "females", -#' age = "ages 50+", -#' year = "latest 5 year average") +#' mortality_cancer( +#' area = "wa", +#' areatype = "hsa", +#' cancer = "ovary", +#' race = "all races (includes hispanic)", +#' sex = "females", +#' age = "ages 50+", +#' year = "latest 5 year average" +#' ) #' } mortality_cancer <- function(area, areatype, cancer, race, sex, age, year) { female_cancer <- c("breast (female)", "ovary", "uterus (corpus & uterus, nos)") - + childhood_cancer <- c("childhood (ages <15, all sites)", "childhood (ages <20, all sites)") - + if ((areatype == "county" || areatype == "hsa") && year == "latest single year (us by state)") { cli_abort("For year latest single year (us by state), areatype must be state") } - + if ((cancer %in% female_cancer) && (sex == "males" || sex == "both sexes")) { cli_abort("For this cancer type, sex must be females") } else if (cancer == "prostate" && (sex == "females" || sex == "both sexes")) { cli_abort("For prostate cancer, sex must be males.") } - + if (cancer == "childhood (ages <15, all sites)" && age != "ages <15") { cli_abort("For childhood (ages <15, all sites), age must be ages <15") - } else if (cancer == "childhood (ages <20, all sites)" && age !="ages <20") { + } else if (cancer == "childhood (ages <20, all sites)" && age != "ages <20") { cli_abort("For childhood (ages <20, all sites), age must be ages <20") } else if ((!cancer %in% childhood_cancer) && (age == "ages <15" || age == "ages <20")) { cli_abort("For this cancer type, age cannot be ages <15 or ages <20") } - + req <- create_request("deathrates") - + resp <- req %>% req_url_query( - stateFIPS=fips_scp(area), - areatype=tolower(areatype), - cancer=handle_cancer(cancer), - race=handle_race(race), - age=handle_age(age), - year=handle_year(year), - type="death", - sortVariableName="rate", - sortOrder="default", - output=1 + stateFIPS = fips_scp(area), + areatype = tolower(areatype), + cancer = handle_cancer(cancer), + race = handle_race(race), + age = handle_age(age), + year = handle_year(year), + type = "death", + sortVariableName = "rate", + sortOrder = "default", + output = 1 ) - - if(!is.null(sex)) { + + if (!is.null(sex)) { resp <- resp %>% - req_url_query(sex=handle_sex(sex)) + req_url_query(sex = handle_sex(sex)) } - + resp <- resp %>% req_perform() - + resp <- process_mortality(resp) - + areatype_map <- c("county" = "County", "hsa" = "Health_Service_Area", "state" = "State") areatype_title <- areatype_map[areatype] - + areacode_map <- c("county" = "FIPS", "state" = "FIPS", "hsa" = "HSA_Code") areacode_title <- areacode_map[areatype] - - resp %>% - setNames(c(areatype_title, areacode_title, "Met Healthy People Objective of ***?", "Age Adjusted Death Rate", "Lower 95% CI Rate", "Upper 95% CI Rate", - "CI Rank", "Lower CI Rank", "Upper CI Rank", "Annual Average Count", "Recent Trend", - "Recent 5 Year Trend", "Lower 95% CI Trend", "Upper 95% CI Trend")) + + resp %>% + setNames(c( + areatype_title, areacode_title, "Met Healthy People Objective of ***?", "Age Adjusted Death Rate", "Lower 95% CI Rate", "Upper 95% CI Rate", + "CI Rank", "Lower CI Rank", "Upper CI Rank", "Annual Average Count", "Recent Trend", + "Recent 5 Year Trend", "Lower 95% CI Trend", "Upper 95% CI Trend" + )) } diff --git a/R/process-incidence.R b/R/process-incidence.R index 589391c..b196c0b 100644 --- a/R/process-incidence.R +++ b/R/process-incidence.R @@ -1,51 +1,51 @@ #' Process Cancer Incidence Response Data -#' +#' #' This function processes the Cancer Incidence response data from State Cancer Profiles #' #' @param resp A response object -#' +#' #' @importFrom httr2 resp_body_string #' @importFrom dplyr mutate_all na_if filter mutate rename #' @importFrom rlang sym := #' @importFrom utils read.csv data #' @importFrom stringr str_replace_all -#' +#' #' @returns A processed response data frame -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' process_incidence(resp) #' } process_incidence <- function(resp) { - nenv <- new.env() data("state", envir = nenv) state.name <- nenv$state.name - + resp_lines <- resp %>% - resp_body_string() %>% - strsplit("\\n") %>% unlist() - + resp_body_string() %>% + strsplit("\\n") %>% + unlist() + index_first_line_break <- which(resp_lines == "")[4] index_second_line_break <- which(resp_lines == "")[5] - - resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break -1)] %>% - paste(collapse = "\n") %>% - (\(x) read.csv(textConnection(x), header=TRUE, colClasses = "character"))() - - + + resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break - 1)] %>% + paste(collapse = "\n") %>% + (\(x) read.csv(textConnection(x), header = TRUE, colClasses = "character"))() + + column <- c("County", "Health.Service.Area", "State")[c("County", "Health.Service.Area", "State") %in% colnames(resp)] - - resp <- resp %>% + + resp <- resp %>% filter(!!sym(column) != "US (SEER+NPCR)(1)") %>% mutate(!!sym(column) := str_replace_all(!!sym(column), "\\(\\d+\\)", "")) - - - if(column %in% c("Health.Service.Area", "County")) { - resp <- resp %>% - filter(!(!!sym(column) %in% state.name)) + + + if (column %in% c("Health.Service.Area", "County")) { + resp <- resp %>% + filter(!(!!sym(column) %in% state.name)) } resp } diff --git a/R/process-mortality.R b/R/process-mortality.R index 29ae357..47840b0 100644 --- a/R/process-mortality.R +++ b/R/process-mortality.R @@ -1,51 +1,51 @@ #' Process Cancer Mortality Response Data -#' +#' #' This function processes the Cancer Mortality response data from State Cancer Profiles #' #' @param resp A response object -#' +#' #' @importFrom httr2 resp_body_string #' @importFrom dplyr mutate_all na_if filter #' @importFrom rlang sym #' @importFrom utils read.csv data -#' +#' #' @returns A processed response data frame -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' process_mortality(resp) #' } process_mortality <- function(resp) { - nenv <- new.env() data("state", envir = nenv) state.name <- nenv$state.name - + resp_lines <- resp %>% - resp_body_string() %>% - strsplit("\\n") %>% unlist() - + resp_body_string() %>% + strsplit("\\n") %>% + unlist() + index_first_line_break <- which(resp_lines == "")[4] index_second_line_break <- which(resp_lines == "")[5] - - resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break -1)] %>% - paste(collapse = "\n") %>% - (\(x) read.csv(textConnection(x), header=TRUE, colClasses = "character"))() - - + + resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break - 1)] %>% + paste(collapse = "\n") %>% + (\(x) read.csv(textConnection(x), header = TRUE, colClasses = "character"))() + + column <- c("County", "Health.Service.Area", "State")[c("County", "Health.Service.Area", "State") %in% colnames(resp)] - - resp <- resp %>% + + resp <- resp %>% filter(!!sym(column) != "United States") - - if(column %in% c("Health.Service.Area", "County")) { + + if (column %in% c("Health.Service.Area", "County")) { resp <- resp %>% filter(!(!!sym(column) %in% state.name)) } - + resp %>% - mutate_all(\(x) na_if(x, "N/A")) %>% + mutate_all(\(x) na_if(x, "N/A")) %>% mutate_all(\(x) na_if(x, "data not available")) } diff --git a/R/process-response.R b/R/process-response.R index b9f8820..2be7f75 100644 --- a/R/process-response.R +++ b/R/process-response.R @@ -1,52 +1,52 @@ #' Process Response Data -#' +#' #' This function processes the response data from State Cancer Profiles #' #' @param resp A response object -#' +#' #' @importFrom httr2 resp_body_string #' @importFrom dplyr mutate_all na_if filter #' @importFrom rlang sym #' @importFrom utils read.csv data -#' +#' #' @returns A processed response data frame -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' process_response(resp) #' } process_response <- function(resp) { - nenv <- new.env() data("state", envir = nenv) state.name <- nenv$state.name - + resp_lines <- resp %>% - resp_body_string() %>% - strsplit("\\n") %>% unlist() - + resp_body_string() %>% + strsplit("\\n") %>% + unlist() + index_first_line_break <- which(resp_lines == "")[1] index_second_line_break <- which(resp_lines == "")[2] - - resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break -1)] %>% - paste(collapse = "\n") %>% - (\(x) read.csv(textConnection(x), header=TRUE, colClasses = "character"))() - - # resp <- resp %>% + + resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break - 1)] %>% + paste(collapse = "\n") %>% + (\(x) read.csv(textConnection(x), header = TRUE, colClasses = "character"))() + + # resp <- resp %>% # read.csv(text=.) column <- c("Health.Service.Area", "County", "State")[c("Health.Service.Area", "County", "State") %in% colnames(resp)] - - resp <- resp %>% + + resp <- resp %>% filter(!!sym(column) != "United States") - - if(column %in% c("Health.Service.Area", "County")) { + + if (column %in% c("Health.Service.Area", "County")) { resp <- resp %>% filter(!(!!sym(column) %in% state.name)) } - resp %>% - mutate_all(\(x) na_if(x, "N/A")) %>% + resp %>% + mutate_all(\(x) na_if(x, "N/A")) %>% mutate_all(\(x) na_if(x, "data not available")) -} \ No newline at end of file +} diff --git a/R/process-screening.R b/R/process-screening.R index 5fab4aa..99662ed 100644 --- a/R/process-screening.R +++ b/R/process-screening.R @@ -1,45 +1,45 @@ #' Process Response Data -#' +#' #' This function processes the response data from State Cancer Profiles #' #' @param resp A response object -#' +#' #' @importFrom httr2 resp_body_string #' @importFrom dplyr mutate_all na_if filter #' @importFrom rlang sym #' @importFrom utils read.csv data -#' +#' #' @returns A processed response data frame -#' +#' #' @noRd -#' +#' #' @examples #' \dontrun{ #' process_screening(resp) #' } process_screening <- function(resp) { - nenv <- new.env() data("state", envir = nenv) state.name <- nenv$state.name - + resp_lines <- resp %>% - resp_body_string() %>% - strsplit("\\n") %>% unlist() - + resp_body_string() %>% + strsplit("\\n") %>% + unlist() + index_first_line_break <- which(resp_lines == "")[3] index_second_line_break <- which(resp_lines == "")[4] - - resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break -1)] %>% - paste(collapse = "\n") %>% - (\(x) read.csv(textConnection(x), header=TRUE, colClasses = "character"))() - + + resp <- resp_lines[(index_first_line_break + 1):(index_second_line_break - 1)] %>% + paste(collapse = "\n") %>% + (\(x) read.csv(textConnection(x), header = TRUE, colClasses = "character"))() + column <- c("County", "State")[c("County", "State") %in% colnames(resp)] - - resp <- resp %>% + + resp <- resp %>% filter(!!sym(column) != "United States") - resp %>% - mutate_all(\(x) na_if(x, "N/A")) %>% + resp %>% + mutate_all(\(x) na_if(x, "N/A")) %>% mutate_all(\(x) na_if(x, "data not available")) } diff --git a/R/risk-alcohol.R b/R/risk-alcohol.R index d48e709..684dbb2 100644 --- a/R/risk-alcohol.R +++ b/R/risk-alcohol.R @@ -1,8 +1,8 @@ #' Access to Alcohol Screening and Risk Data -#' +#' #' This function returns a data frame about alcohol risks from State Cancer Profiles. #' -#' @param alcohol The only permissible value is +#' @param alcohol The only permissible value is #' `"binge drinking (4+ drinks on one occasion for women, 5+ drinks for one occasion for men), ages 21+"`. #' @param race One of the following values: #' - `"All Races (includes Hispanic)"` @@ -15,37 +15,40 @@ #' - `"both sexes"` #' - `"male"` #' - `"female"`. -#' +#' #' @returns A data frame with the following columns: Area Type, Area Code, Percent, Lower 95% CI, Upper 95% CI, Number of Respondents. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' risk_alcohol(alcohol = paste("binge drinking (4+ drinks on one occasion for women,", -#' "5+ drinks for one occasion for men), ages 21+"), -#' race = "all races (includes hispanic)", -#' sex = "both sexes") +#' risk_alcohol( +#' alcohol = paste( +#' "binge drinking (4+ drinks on one occasion for women,", +#' "5+ drinks for one occasion for men), ages 21+" +#' ), +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) #' } risk_alcohol <- function(alcohol, race, sex) { - req <- create_request("risk") - + resp <- req %>% req_url_query( - topic="alcohol", - risk=handle_alcohol(alcohol), - race=handle_race(race), - sex=handle_sex(sex), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "alcohol", + risk = handle_alcohol(alcohol), + race = handle_race(race), + sex = handle_sex(sex), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) %>% req_perform() - + resp <- process_screening(resp) - - resp %>% + + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } diff --git a/R/risk-colorectal-screening.R b/R/risk-colorectal-screening.R index 9a2d328..c824892 100644 --- a/R/risk-colorectal-screening.R +++ b/R/risk-colorectal-screening.R @@ -1,6 +1,7 @@ #' Access to Colorectal Screening Data -#' -#' This function returns a data frame about colorectal screening from State Cancer Profiles. +#' +#' This function returns a data frame about +#' colorectal screening from State Cancer Profiles. #' #' @param screening One of the following values: #' - `"ever had fobt, ages 50-75"` @@ -20,34 +21,44 @@ #' - `"male"` #' - `"female"`. #' @param area A state/territory abbreviation or USA. -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, People Unemployed, Rank. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, People Unemployed, Rank. +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' risk_colorectal_screening(screening = "home blood stool test in the past year, ages 45-75", -#' race = "all races (includes hispanic)", -#' sex = "both sexes") -#' -#' risk_colorectal_screening(screening = "ever had fobt, ages 50-75", -#' area="usa") -#' risk_colorectal_screening(screening = "received at least one recommended crc test, ages 45-75", -#' race = "all races (includes hispanic)", -#' sex = "both sexes") +#' risk_colorectal_screening( +#' screening = "home blood stool test in the past year, ages 45-75", +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) +#' +#' risk_colorectal_screening( +#' screening = "ever had fobt, ages 50-75", +#' area = "usa" +#' ) +#' risk_colorectal_screening( +#' screening = "received at least one recommended crc test, ages 45-75", +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) #' } -risk_colorectal_screening <- function(screening, race=NULL, sex=NULL, area=NULL) { - +risk_colorectal_screening <- function(screening, race = NULL, sex = NULL, area = NULL) { req <- create_request("risk") - - screening_type_1 = c("home blood stool test in the past year, ages 45-75", - "received at least one recommended crc test, ages 45-75") - - screening_type_2 = c("ever had fobt, ages 50-75", - "guidance sufficient crc, ages 50-75", - "had colonoscopy in past 10 years, ages 50-75") - + + screening_type_1 <- c( + "home blood stool test in the past year, ages 45-75", + "received at least one recommended crc test, ages 45-75" + ) + + screening_type_2 <- c( + "ever had fobt, ages 50-75", + "guidance sufficient crc, ages 50-75", + "had colonoscopy in past 10 years, ages 50-75" + ) + if (screening %in% screening_type_1 && ((is.null(race) || is.null(sex)) || !is.null(area))) { cli_abort("For this screening type, Race and Sex must not be NULL, and Area must be NULL") } else if (screening %in% screening_type_2 && (is.null(area) || (!is.null(race) || !is.null(sex)))) { @@ -56,39 +67,39 @@ risk_colorectal_screening <- function(screening, race=NULL, sex=NULL, area=NULL) resp <- req %>% req_url_query( - topic="colorec", - risk=handle_screening(screening), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "colorec", + risk = handle_screening(screening), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) - - if(!is.null(race)) { + + if (!is.null(race)) { resp <- resp %>% - req_url_query(race=handle_race(race)) + req_url_query(race = handle_race(race)) } - - if(!is.null(sex)) { + + if (!is.null(sex)) { resp <- resp %>% - req_url_query(sex=handle_sex(sex)) + req_url_query(sex = handle_sex(sex)) } - - if(!is.null(area)) { + + if (!is.null(area)) { resp <- resp %>% - req_url_query(stateFIPS=fips_scp(area)) + req_url_query(stateFIPS = fips_scp(area)) } - + resp <- resp %>% req_perform() - + resp <- process_screening(resp) if (screening %in% screening_type_1) { - resp %>% + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } else if (screening %in% screening_type_2) { - resp %>% + resp %>% setNames(c("County", "FIPS", "Model_Based_Percent (95%_Confidence_Interval)", "Lower_95%_CI", "Upper_95%_CI")) } } diff --git a/R/risk-diet-exercise.R b/R/risk-diet-exercise.R index 71af815..e4b33e8 100644 --- a/R/risk-diet-exercise.R +++ b/R/risk-diet-exercise.R @@ -1,5 +1,5 @@ #' Access to Diet & Exercise Screening Data -#' +#' #' This function returns a data frame about diet and exercise risk from State Cancer Profiles. #' #' @param diet_exercise One of the following values: @@ -21,47 +21,52 @@ #' - `"both sexes"` #' - `"male"` #' - `"female"`. -#' +#' #' @returns A data frame with the following columns: Area Type, Area Code, Percent, Lower 95% CI, Upper 95% CI, Number of Respondents. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' risk_diet_exercise(diet_exercise = "bmi is healthy, ages 20+", -#' race = "all races (includes hispanic)", -#' sex = "both sexes") -#' risk_diet_exercise(diet_exercise = "bmi is obese, high school survey", -#' race = "all races (includes hispanic)", -#' sex = "males") +#' risk_diet_exercise( +#' diet_exercise = "bmi is healthy, ages 20+", +#' race = "all races (includes hispanic)", +#' sex = "both sexes" +#' ) +#' risk_diet_exercise( +#' diet_exercise = "bmi is obese, high school survey", +#' race = "all races (includes hispanic)", +#' sex = "males" +#' ) #' } risk_diet_exercise <- function(diet_exercise, race, sex) { - req <- create_request("risk") - + resp <- req %>% req_url_query( - topic="dietex", - risk=handle_diet_exercise(diet_exercise), - race=handle_race(race), - sex=handle_sex(sex), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "dietex", + risk = handle_diet_exercise(diet_exercise), + race = handle_race(race), + sex = handle_sex(sex), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) %>% req_perform() - + resp <- process_screening(resp) - - diet_exercise_type1 = c("bmi is overweight, high school survey", - "bmi is obese, high school survey") - + + diet_exercise_type1 <- c( + "bmi is overweight, high school survey", + "bmi is obese, high school survey" + ) + if (diet_exercise %in% diet_exercise_type1) { - resp %>% + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI")) } else { - resp %>% + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } } diff --git a/R/risk-smoking.R b/R/risk-smoking.R index e8e1d22..8227cb4 100644 --- a/R/risk-smoking.R +++ b/R/risk-smoking.R @@ -1,10 +1,12 @@ #' Access to Smoking Data -#' -#' This function returns a data frame about smoking risks from State Cancer Profiles. -#' -#' Please note that this function requires very specific arguments for each smoking type. #' -#' @param smoking The only permissible values are +#' This function returns a data frame about smoking risks +#' from State Cancer Profiles. +#' +#' Please note that this function requires +#' very specific arguments for each smoking type. +#' +#' @param smoking The only permissible values are #' - `"smoking laws (any)"` #' - `"smoking laws (bars)"` #' - `"smoking laws (restaurants)"` @@ -37,67 +39,84 @@ #' - `"direct estimates"` #' - `"county level modeled estimates"`. #' @param area A state/territory abbreviation or USA. -#' +#' #' @importFrom httr2 req_url_query req_perform #' @importFrom cli cli_abort #' @importFrom stats setNames -#' -#' @returns A data frame with the following columns: Area Type, Area Code, Percent, Lower CI 95%, Upper CI 95%, Number of Respondents. -#' +#' +#' @returns A data frame with the following columns: +#' Area Type, Area Code, Percent, Lower CI 95%, Upper CI 95%, +#' Number of Respondents. +#' #' @export -#' +#' #' @examples #' \dontrun{ #' risk_smoking(smoking = "smoking laws (any)") -#' -#' risk_smoking(smoking = "smokers (stopped for 1 day or longer)", -#' sex = "both sexes", -#' datatype = "county level modeled estimates", -#' area = "wa") -#' -#' risk_smoking(smoking = "smoking not allowed at work (current smokers)", -#' sex = "both sexes", -#' datatype = "direct estimates") -#' -#' risk_smoking(smoking = "smokers (current); ages 18+", -#' race = "all races (includes hispanic)", -#' sex = "both sexes", -#' datatype = "county level modeled estimates", -#' area="wa") +#' +#' risk_smoking( +#' smoking = "smokers (stopped for 1 day or longer)", +#' sex = "both sexes", +#' datatype = "county level modeled estimates", +#' area = "wa" +#' ) +#' +#' risk_smoking( +#' smoking = "smoking not allowed at work (current smokers)", +#' sex = "both sexes", +#' datatype = "direct estimates" +#' ) +#' +#' risk_smoking( +#' smoking = "smokers (current); ages 18+", +#' race = "all races (includes hispanic)", +#' sex = "both sexes", +#' datatype = "county level modeled estimates", +#' area = "wa" +#' ) #' } -risk_smoking <- function(smoking, race=NULL, sex=NULL, datatype=NULL, area=NULL) { - +risk_smoking <- function(smoking, race = NULL, sex = NULL, datatype = NULL, area = NULL) { req <- create_request("risk") - smoking_group1 = c("smoking laws (any)", - "smoking laws (bars)", - "smoking laws (restaurants)", - "smoking laws (workplace)", - "smoking laws (workplace; restaurant; & bar)") - - smoking_group2 = c("smokers (stopped for 1 day or longer)", - "smoking not allowed at work (all people)", - "smoking not allowed in home (all people)") - - smoking_group3 = c("smoking not allowed at work (current smokers)", - "smoking not allowed at work (former/never smokers)", - "smoking not allowed in home (current smokers)", - "smoking not allowed in home (former/never smokers)") - - smoking_group4 = c("former smoker; ages 18+", - "former smoker, quit 1 year+; ages 18+") - - smoking_group5 = c("smokers (ever); ages 18+", - "e-cigarette use; ages 18+") - - smoking_group6 = "smokers (current); ages 18+" - - #smoking group 1 + smoking_group1 <- c( + "smoking laws (any)", + "smoking laws (bars)", + "smoking laws (restaurants)", + "smoking laws (workplace)", + "smoking laws (workplace; restaurant; & bar)" + ) + + smoking_group2 <- c( + "smokers (stopped for 1 day or longer)", + "smoking not allowed at work (all people)", + "smoking not allowed in home (all people)" + ) + + smoking_group3 <- c( + "smoking not allowed at work (current smokers)", + "smoking not allowed at work (former/never smokers)", + "smoking not allowed in home (current smokers)", + "smoking not allowed in home (former/never smokers)" + ) + + smoking_group4 <- c( + "former smoker; ages 18+", + "former smoker, quit 1 year+; ages 18+" + ) + + smoking_group5 <- c( + "smokers (ever); ages 18+", + "e-cigarette use; ages 18+" + ) + + smoking_group6 <- "smokers (current); ages 18+" + + # smoking group 1 if (smoking %in% smoking_group1 && (!is.null(race) || !is.null(sex) || !is.null(sex) || !is.null(area))) { cli_abort("For this smoking type, Race, Sex, Datatype, and Area must ALL be NULL") } - - #smoking group 2 + + # smoking group 2 if (smoking %in% smoking_group2 && !is.null(sex)) { if (sex == "both sexes") { if (datatype == "county level modeled estimates" && is.null(area)) { @@ -113,8 +132,8 @@ risk_smoking <- function(smoking, race=NULL, sex=NULL, datatype=NULL, area=NULL) } else if (smoking %in% smoking_group2 && is.null(sex)) { cli_abort("For this smoking type, sex must NOT be NULL") } - - #smoking group 3 + + # smoking group 3 if (smoking %in% smoking_group3 && !is.null(sex)) { if (!is.null(race) || !is.null(area)) { cli_abort("For all sexes in this smoking type, race and area should be NULL") @@ -122,22 +141,22 @@ risk_smoking <- function(smoking, race=NULL, sex=NULL, datatype=NULL, area=NULL) } else if (smoking %in% smoking_group3 && (is.null(sex) || is.null(datatype))) { cli_abort("For this smoking type, sex and dattype must NOT be NULL") } - - #smoking group 4 + + # smoking group 4 if (smoking %in% smoking_group4 && ((is.null(sex) || is.null(area) || is.null(datatype)) || !is.null(race))) { cli_abort("For this smoking type, Sex, Datatype, and Area must not be NULL AND Race must be NULL") } else if (smoking %in% smoking_group4 && datatype == "direct estimates") { cli_abort("For this smoking type, Datatype must be county level modeled estimates") } - - #smoking group 5 + + # smoking group 5 if (smoking %in% smoking_group5 && ((is.null(race) || is.null(sex) || is.null(datatype)) || !is.null(area))) { cli_abort("For this smoking type, Race, Sex, and Datatype must not be NULL AND Datatype and Area must be NULL") } else if (smoking %in% smoking_group5 && datatype == "county level modeled estimates") { cli_abort("For this smoking type, Datatype must be direct estimates") } - - #smoking group 6 + + # smoking group 6 if (smoking %in% smoking_group6 && (is.null(race) || is.null(sex))) { cli_abort("For this smoking group, Race and Sex must not be NULL") } else if (smoking %in% smoking_group6 && (!is.null(race) && !is.null(sex)) && race == "all races (includes hispanic)") { @@ -147,55 +166,55 @@ risk_smoking <- function(smoking, race=NULL, sex=NULL, datatype=NULL, area=NULL) cli_abort("For direct estimates for this smoking type, Area must be NULL") } else if (datatype == "county level modeled estimates" && is.null(area)) { cli_abort("For county level modeled estimates for this smoking type, Area must NOT be NULL") - } + } } - + resp <- req %>% req_url_query( - topic="smoke", - risk=handle_smoking(smoking), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "smoke", + risk = handle_smoking(smoking), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) - - if(!is.null(race)) { + + if (!is.null(race)) { resp <- resp %>% - req_url_query(race=handle_race(race)) + req_url_query(race = handle_race(race)) } - - if(!is.null(sex)) { + + if (!is.null(sex)) { resp <- resp %>% - req_url_query(sex=handle_sex(sex)) + req_url_query(sex = handle_sex(sex)) } - - if(!is.null(datatype)) { + + if (!is.null(datatype)) { resp <- resp %>% - req_url_query(datatype=handle_datatype(datatype)) + req_url_query(datatype = handle_datatype(datatype)) } - - if(!is.null(area)) { + + if (!is.null(area)) { resp <- resp %>% - req_url_query(stateFIPS=fips_scp(area)) + req_url_query(stateFIPS = fips_scp(area)) } - + resp <- resp %>% req_perform() - + resp <- process_screening(resp) - - + + if (smoking %in% smoking_group1) { - resp %>% - setNames(c("State", "FIPS", "Percent")) - } else if ((smoking %in% c(smoking_group2, smoking_group3, smoking_group4, smoking_group5, smoking_group6)) - && (datatype=="direct estimates")) { - resp %>% - setNames(c("State", "FIPS", "Percent", "Lower_CI_95%", "Upper_CI_95%", "Number_of_Respondents")) - } else if ((smoking %in% c(smoking_group2, smoking_group3, smoking_group4, smoking_group5, smoking_group6) - && datatype=="county level modeled estimates")) { - resp %>% - setNames(c("County", "FIPS", "Percent", "Lower_CI_95%", "Upper_CI_95%")) + resp %>% + setNames(c("State", "FIPS", "Percent")) + } else if ((smoking %in% c(smoking_group2, smoking_group3, smoking_group4, smoking_group5, smoking_group6)) && + (datatype == "direct estimates")) { + resp %>% + setNames(c("State", "FIPS", "Percent", "Lower_CI_95%", "Upper_CI_95%", "Number_of_Respondents")) + } else if ((smoking %in% c(smoking_group2, smoking_group3, smoking_group4, smoking_group5, smoking_group6) && + datatype == "county level modeled estimates")) { + resp %>% + setNames(c("County", "FIPS", "Percent", "Lower_CI_95%", "Upper_CI_95%")) } } diff --git a/R/risk-vaccines.R b/R/risk-vaccines.R index 3ba4495..5ec87ac 100644 --- a/R/risk-vaccines.R +++ b/R/risk-vaccines.R @@ -1,5 +1,5 @@ #' Access to Vaccines Data -#' +#' #' This function returns a data frame about vaccines risks from State Cancer Profiles. #' #' @param vaccine One of the following values: @@ -11,47 +11,51 @@ #' - `"female"`. #' #' @returns A data frame with the following columns: Area Type, Area Code, Percent, Lower 95% CI, Upper 95% CI, Number of Respondents. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' risk_vaccines(vaccine = "percent with up to date hpv vaccination coverage, ages 13-15", -#' sex = "both sexes") -#' -#' risk_vaccines(vaccine = "percent with up to date hpv vaccination coverage, ages 13-17", -#' sex = "females") +#' risk_vaccines( +#' vaccine = "percent with up to date hpv vaccination coverage, ages 13-15", +#' sex = "both sexes" +#' ) +#' +#' risk_vaccines( +#' vaccine = "percent with up to date hpv vaccination coverage, ages 13-17", +#' sex = "females" +#' ) #' } risk_vaccines <- function(vaccine, sex) { - req <- create_request("risk") - + resp <- req %>% req_url_query( - topic="vaccine", - risk=handle_vaccine(vaccine), - sex=handle_sex(sex), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "vaccine", + risk = handle_vaccine(vaccine), + sex = handle_sex(sex), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) - + resp <- resp %>% req_perform() - + resp <- process_screening(resp) - - - vaccine_type1 = c("percent who received 2+ doses of HPV vaccine, ages 13-15", - "percent who received 3+ doses of HPV vaccine, ages 13-15" - ) - + + + vaccine_type1 <- c( + "percent who received 2+ doses of HPV vaccine, ages 13-15", + "percent who received 3+ doses of HPV vaccine, ages 13-15" + ) + if (vaccine %in% vaccine_type1) { - resp %>% + resp %>% setNames(c("State", "FIPS", "Met_Objective_of_80.0%?", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } else { - resp %>% + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } } diff --git a/R/risk-womens-health.R b/R/risk-womens-health.R index 1ad28f3..9c5a255 100644 --- a/R/risk-womens-health.R +++ b/R/risk-womens-health.R @@ -1,5 +1,5 @@ #' Access to Women's Health Data -#' +#' #' This function returns a data frame about women's health risks from State Cancer Profiles. #' #' @param women_health One of the following values: @@ -17,33 +17,40 @@ #' - `"direct estimates"` #' - `"county level modeled estimates"`. #' @param area A state/territory abbreviation or USA. -#' +#' #' @returns A data frame with the following columns: Area Type, Area Code, Percent, People Unemployed, Rank. -#' +#' #' @export -#' +#' #' @examples #' \dontrun{ -#' risk_women_health(women_health = "mammogram in past 2 years, ages 50-74", -#' race = "all races (includes hispanic)", -#' datatype = "direct estimates") -#' -#' risk_women_health(women_health = "pap smear in past 3 years, no hysterectomy, ages 21-65", -#' race = "all races (includes hispanic)", -#' datatype = "county level modeled estimates", -#' area = "wa") -#' -#' risk_women_health(women_health = "pap smear in past 3 years, no hysteroetomy, ages 21-65", -#' race = "black (non-hispanic)") +#' risk_women_health( +#' women_health = "mammogram in past 2 years, ages 50-74", +#' race = "all races (includes hispanic)", +#' datatype = "direct estimates" +#' ) +#' +#' risk_women_health( +#' women_health = "pap smear in past 3 years, no hysterectomy, ages 21-65", +#' race = "all races (includes hispanic)", +#' datatype = "county level modeled estimates", +#' area = "wa" +#' ) +#' +#' risk_women_health( +#' women_health = "pap smear in past 3 years, no hysteroetomy, ages 21-65", +#' race = "black (non-hispanic)" +#' ) #' } -risk_women_health <- function(women_health, race, datatype="direct estimates", area=NULL) { - +risk_women_health <- function(women_health, race, datatype = "direct estimates", area = NULL) { req <- create_request("risk") - - risk_races = c("all races (includes hispanic)", "white (non-hispanic)", "black (non-hispanic)", - "amer. indian / ak native (non-hispanic)", "asian / pacific islander (non-hispanic)", - "hispanic (any race)") - + + risk_races <- c( + "all races (includes hispanic)", "white (non-hispanic)", "black (non-hispanic)", + "amer. indian / ak native (non-hispanic)", "asian / pacific islander (non-hispanic)", + "hispanic (any race)" + ) + if (race == "all races (includes hispanic)" && is.null(datatype)) { cli_abort("For all races (includes hispanic), datatype must NOT be NULL") } else if ((race %in% risk_races && race != "all races (includes hispanic)") && (!is.null(area))) { @@ -54,40 +61,40 @@ risk_women_health <- function(women_health, race, datatype="direct estimates", a resp <- req %>% req_url_query( - topic="women", - risk=handle_women_health(women_health), - race=handle_race(race), - type="risk", - sortVariableName="percent", - sortOrder="default", - output=1 + topic = "women", + risk = handle_women_health(women_health), + race = handle_race(race), + type = "risk", + sortVariableName = "percent", + sortOrder = "default", + output = 1 ) - - if(!is.null(datatype)) { + + if (!is.null(datatype)) { resp <- resp %>% - req_url_query(datatype=handle_datatype(datatype)) + req_url_query(datatype = handle_datatype(datatype)) } - - if(!is.null(area)) { + + if (!is.null(area)) { resp <- resp %>% - req_url_query(stateFIPS=fips_scp(area)) + req_url_query(stateFIPS = fips_scp(area)) } - + resp <- resp %>% req_perform() - + resp <- process_screening(resp) - + if (datatype == "county level modeled estimates") { - if(women_health == "pap smear in past 3 years, no hysterectomy, ages 21-65") { - resp %>% + if (women_health == "pap smear in past 3 years, no hysterectomy, ages 21-65") { + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } else { - resp %>% + resp %>% setNames(c("County", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI")) } } else { - resp %>% + resp %>% setNames(c("State", "FIPS", "Percent", "Lower_95%_CI", "Upper_95%_CI", "Number_of_Respondents")) } } diff --git a/R/test-dput-resp-incd.R b/R/test-dput-resp-incd.R index a868be3..539c513 100644 --- a/R/test-dput-resp-incd.R +++ b/R/test-dput-resp-incd.R @@ -1,460 +1,464 @@ #' Test dput-resp-incidence -#' +#' #' This function creates a response object from the Incidence section of State Cancer Profiles for #' -#' +#' #' @returns A httr2 response object -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' dput_resp_incd() #' } dput_resp_incd <- function() { - resp <- structure(list(method = "GET", url = "https://statecancerprofiles.cancer.gov/incidencerates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&stage=999&year=0&type=incd&sortVariableName=rate&sortOrder=default&output=1&sex=0", - status_code = 200L, headers = structure(list(date = "Wed, 21 Feb 2024 19:21:05 GMT", - server = "Apache", `content-disposition` = "attachment; filename=\"incd.csv\"", - `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", - `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", - `set-cookie` = "TKTID=web-dmzst-03; path=/; HttpOnly; Secure", - `cache-control` = "private"), class = "httr2_headers"), - body = as.raw(c(0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, - 0x63, 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x20, 0x52, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, - 0x65, 0x6c, 0x61, 0x77, 0x61, 0x72, 0x65, 0x20, 0x62, 0x79, - 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x0a, 0x0a, 0x22, - 0x41, 0x6c, 0x6c, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, - 0x20, 0x53, 0x69, 0x74, 0x65, 0x73, 0x20, 0x28, 0x41, 0x6c, - 0x6c, 0x20, 0x53, 0x74, 0x61, 0x67, 0x65, 0x73, 0x5e, 0x29, - 0x2c, 0x20, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x32, 0x30, 0x32, - 0x30, 0x22, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, 0x52, - 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, 0x69, 0x73, 0x70, 0x61, - 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, 0x42, 0x6f, 0x74, 0x68, - 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, 0x2c, 0x20, 0x41, 0x67, - 0x65, 0x73, 0x20, 0x36, 0x35, 0x2b, 0x22, 0x0a, 0x0a, 0x53, - 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x52, - 0x61, 0x74, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, 0x22, 0x41, - 0x67, 0x65, 0x2d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, - 0x64, 0x20, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x28, 0x5b, 0x72, 0x61, - 0x74, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, - 0x2d, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x70, 0x65, - 0x72, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x30, 0x22, - 0x2c, 0x22, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x39, 0x35, - 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, - 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x22, 0x2c, 0x22, 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, - 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x43, 0x49, 0x2a, 0x52, - 0x61, 0x6e, 0x6b, 0x28, 0x5b, 0x72, 0x61, 0x6e, 0x6b, 0x20, - 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x22, 0x2c, 0x22, 0x4c, - 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x43, - 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, 0x22, - 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, - 0x43, 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, - 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x2c, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x72, - 0x65, 0x6e, 0x64, 0x2c, 0x22, 0x52, 0x65, 0x63, 0x65, 0x6e, - 0x74, 0x20, 0x35, 0x2d, 0x59, 0x65, 0x61, 0x72, 0x20, 0x54, - 0x72, 0x65, 0x6e, 0x64, 0x20, 0x28, 0x5b, 0x74, 0x72, 0x65, - 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, - 0x69, 0x6e, 0x20, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, - 0x63, 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, - 0x22, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, - 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x22, 0x2c, 0x22, 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x39, - 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, - 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, - 0x61, 0x6c, 0x22, 0x0a, 0x22, 0x44, 0x65, 0x6c, 0x61, 0x77, - 0x61, 0x72, 0x65, 0x28, 0x36, 0x29, 0x22, 0x2c, 0x31, 0x30, - 0x30, 0x30, 0x30, 0x2c, 0x31, 0x39, 0x39, 0x35, 0x2e, 0x38, - 0x20, 0x2c, 0x31, 0x39, 0x36, 0x36, 0x2e, 0x32, 0x2c, 0x20, - 0x32, 0x30, 0x32, 0x35, 0x2e, 0x37, 0x2c, 0x4e, 0x2f, 0x41, - 0x20, 0x2c, 0x20, 0x31, 0x34, 0x20, 0x2c, 0x20, 0x33, 0x32, - 0x2c, 0x33, 0x35, 0x36, 0x37, 0x2c, 0x66, 0x61, 0x6c, 0x6c, - 0x69, 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x34, 0x20, 0x2c, - 0x2d, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, - 0x0a, 0x22, 0x55, 0x53, 0x20, 0x28, 0x53, 0x45, 0x45, 0x52, - 0x2b, 0x4e, 0x50, 0x43, 0x52, 0x29, 0x28, 0x31, 0x29, 0x22, - 0x2c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x31, 0x39, 0x34, - 0x34, 0x2e, 0x34, 0x20, 0x2c, 0x31, 0x39, 0x34, 0x32, 0x2e, - 0x36, 0x2c, 0x20, 0x31, 0x39, 0x34, 0x36, 0x2e, 0x31, 0x2c, - 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x20, - 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x2c, 0x39, 0x37, 0x31, 0x38, - 0x32, 0x38, 0x2c, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c, - 0x2d, 0x30, 0x2e, 0x35, 0x20, 0x2c, 0x2d, 0x30, 0x2e, 0x38, - 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x0a, 0x22, 0x4b, 0x65, 0x6e, - 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x28, 0x36, - 0x29, 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x31, 0x2c, 0x32, - 0x30, 0x39, 0x32, 0x2e, 0x38, 0x20, 0x2c, 0x32, 0x30, 0x32, - 0x30, 0x2c, 0x20, 0x32, 0x31, 0x36, 0x37, 0x2e, 0x35, 0x2c, - 0x31, 0x20, 0x2c, 0x20, 0x31, 0x20, 0x2c, 0x20, 0x31, 0x2c, - 0x36, 0x33, 0x36, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, - 0x67, 0x2c, 0x2d, 0x32, 0x2e, 0x30, 0x20, 0x2c, 0x2d, 0x32, - 0x2e, 0x37, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x34, 0x0a, 0x22, - 0x4e, 0x65, 0x77, 0x20, 0x43, 0x61, 0x73, 0x74, 0x6c, 0x65, - 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x28, 0x36, 0x29, - 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x33, 0x2c, 0x31, 0x39, - 0x39, 0x38, 0x20, 0x2c, 0x31, 0x39, 0x35, 0x35, 0x2e, 0x34, - 0x2c, 0x20, 0x32, 0x30, 0x34, 0x31, 0x2e, 0x32, 0x2c, 0x32, - 0x20, 0x2c, 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x31, - 0x37, 0x31, 0x34, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, - 0x67, 0x2c, 0x2d, 0x30, 0x2e, 0x39, 0x20, 0x2c, 0x2d, 0x31, - 0x2e, 0x34, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x34, 0x0a, 0x22, - 0x53, 0x75, 0x73, 0x73, 0x65, 0x78, 0x20, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x79, 0x28, 0x36, 0x29, 0x22, 0x2c, 0x31, 0x30, - 0x30, 0x30, 0x35, 0x2c, 0x31, 0x39, 0x34, 0x36, 0x2e, 0x39, - 0x20, 0x2c, 0x31, 0x38, 0x39, 0x37, 0x2e, 0x32, 0x2c, 0x20, - 0x31, 0x39, 0x39, 0x37, 0x2e, 0x36, 0x2c, 0x33, 0x20, 0x2c, - 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x31, 0x32, 0x31, - 0x36, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, - 0x2d, 0x33, 0x2e, 0x31, 0x20, 0x2c, 0x2d, 0x35, 0x2e, 0x39, - 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, 0x0a, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, - 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x20, - 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, 0x31, 0x2f, 0x32, - 0x30, 0x32, 0x34, 0x20, 0x32, 0x3a, 0x32, 0x31, 0x20, 0x70, - 0x6d, 0x2e, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6d, 0x61, - 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, - 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, - 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x0a, 0x0a, 0x0a, 0x54, 0x72, 0x65, 0x6e, 0x64, - 0x0a, 0x20, 0x20, 0x20, 0x52, 0x69, 0x73, 0x69, 0x6e, 0x67, - 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, - 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x76, - 0x65, 0x20, 0x30, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x53, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, - 0x39, 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, - 0x6c, 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x30, 0x2e, 0x0a, 0x20, - 0x20, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, - 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x6f, - 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, - 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, - 0x20, 0x30, 0x2e, 0x0a, 0x0a, 0x22, 0x5b, 0x72, 0x61, 0x74, - 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x20, 0x49, 0x6e, - 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x72, 0x61, - 0x74, 0x65, 0x73, 0x20, 0x28, 0x63, 0x61, 0x73, 0x65, 0x73, - 0x20, 0x70, 0x65, 0x72, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x30, - 0x30, 0x30, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x20, 0x79, 0x65, - 0x61, 0x72, 0x29, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x67, - 0x65, 0x2d, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, - 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, - 0x30, 0x30, 0x20, 0x55, 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, - 0x64, 0x61, 0x72, 0x64, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x68, 0x74, 0x74, - 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, - 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, - 0x67, 0x6f, 0x76, 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, - 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, - 0x74, 0x64, 0x70, 0x6f, 0x70, 0x2e, 0x31, 0x39, 0x61, 0x67, - 0x65, 0x73, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x5d, 0x20, 0x28, - 0x31, 0x39, 0x20, 0x61, 0x67, 0x65, 0x20, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x3a, 0x20, 0x3c, 0x31, 0x2c, 0x20, 0x31, - 0x2d, 0x34, 0x2c, 0x20, 0x35, 0x2d, 0x39, 0x2c, 0x20, 0x2e, - 0x2e, 0x2e, 0x20, 0x2c, 0x20, 0x38, 0x30, 0x2d, 0x38, 0x34, - 0x2c, 0x20, 0x38, 0x35, 0x2b, 0x29, 0x2e, 0x20, 0x52, 0x61, - 0x74, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x6f, - 0x72, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, - 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x6f, 0x6e, - 0x6c, 0x79, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, 0x6c, 0x61, 0x64, 0x64, - 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, - 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x69, - 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x69, 0x74, 0x75, 0x29, - 0x20, 0x6f, 0x72, 0x20, 0x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, - 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, - 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x2e, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x20, 0x63, 0x61, - 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x75, - 0x73, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, - 0x53, 0x74, 0x61, 0x74, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, - 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, - 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, - 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x5d, 0x20, - 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, 0x2e, 0x20, 0x54, 0x68, - 0x65, 0x20, 0x55, 0x53, 0x20, 0x50, 0x6f, 0x70, 0x75, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x61, 0x74, 0x61, - 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x5b, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, - 0x2f, 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x5d, - 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x53, 0x45, 0x45, 0x52, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x4e, 0x50, 0x43, 0x52, 0x20, 0x69, 0x6e, 0x63, - 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x72, 0x61, 0x74, - 0x65, 0x73, 0x2e, 0x22, 0x0a, 0x22, 0x5b, 0x74, 0x72, 0x65, - 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x20, 0x49, - 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x64, - 0x61, 0x74, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x66, - 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, - 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, - 0x79, 0x65, 0x61, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x64, - 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x6d, 0x6f, - 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x74, 0x72, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, - 0x20, 0x41, 0x41, 0x50, 0x43, 0x73, 0x20, 0x62, 0x61, 0x73, - 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x50, 0x43, 0x73, - 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, - 0x61, 0x72, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, 0x20, 0x63, - 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, - 0x69, 0x6e, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, 0x53, 0x74, - 0x61, 0x74, 0x2e, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, - 0x61, 0x72, 0x65, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, - 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, - 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x22, 0x0a, 0x0a, 0x52, 0x61, 0x74, 0x65, 0x73, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x72, 0x65, 0x6e, 0x64, - 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x64, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, - 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, - 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x6c, 0x69, 0x67, - 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x2e, 0x20, 0x46, 0x6f, 0x72, - 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x65, - 0x65, 0x20, 0x6d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x6e, - 0x74, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x2e, 0x0a, 0x0a, 0x22, - 0x5e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x67, - 0x65, 0x73, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, - 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x73, 0x74, 0x61, - 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x53, 0x75, 0x72, 0x76, 0x65, 0x69, 0x6c, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x2c, 0x20, 0x45, 0x70, 0x69, 0x64, 0x65, 0x6d, - 0x69, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2c, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x45, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x20, 0x28, 0x53, 0x45, 0x45, 0x52, 0x29, - 0x20, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x73, - 0x74, 0x61, 0x67, 0x65, 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, - 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x73, 0x73, 0x6d, - 0x2f, 0x20, 0x5d, 0x2e, 0x22, 0x0a, 0x22, 0x5b, 0x72, 0x61, - 0x6e, 0x6b, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, - 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, 0x52, 0x61, - 0x6e, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, - 0x69, 0x63, 0x73, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x20, 0x73, - 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, - 0x65, 0x66, 0x75, 0x6c, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x6f, - 0x66, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x2e, 0x20, 0x46, - 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2c, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x66, 0x6f, - 0x72, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, - 0x6c, 0x79, 0x20, 0x72, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, - 0x73, 0x65, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6f, 0x72, 0x20, - 0x6c, 0x65, 0x73, 0x73, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, - 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x61, 0x73, - 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x65, 0x73, - 0x73, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x20, - 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x73, - 0x73, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, - 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x6c, - 0x61, 0x72, 0x67, 0x65, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x62, 0x75, - 0x74, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x66, 0x6f, - 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x20, 0x64, 0x69, 0x73, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, 0x6e, 0x73, - 0x65, 0x6c, 0x79, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, - 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x76, - 0x65, 0x72, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, - 0x2e, 0x20, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, - 0x62, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x20, 0x63, 0x61, 0x6e, - 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, - 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, - 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x2e, 0x22, 0x0a, 0x0a, 0x22, 0x31, 0x20, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x4e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x6f, 0x67, - 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, - 0x64, 0x63, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x2f, 0x6e, 0x70, 0x63, 0x72, 0x2f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x5d, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, - 0x69, 0x6c, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x45, - 0x70, 0x69, 0x64, 0x65, 0x6d, 0x69, 0x6f, 0x6c, 0x6f, 0x67, - 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6e, 0x64, - 0x20, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x5b, - 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x65, - 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, - 0x67, 0x6f, 0x76, 0x20, 0x5d, 0x20, 0x53, 0x45, 0x45, 0x52, - 0x2a, 0x53, 0x74, 0x61, 0x74, 0x20, 0x44, 0x61, 0x74, 0x61, - 0x62, 0x61, 0x73, 0x65, 0x20, 0x2d, 0x20, 0x55, 0x6e, 0x69, - 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, - 0x20, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x48, 0x75, 0x6d, 0x61, - 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2c, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, - 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x4e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x72, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, - 0x74, 0x75, 0x74, 0x65, 0x2e, 0x20, 0x42, 0x61, 0x73, 0x65, - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, - 0x30, 0x32, 0x32, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x0a, 0x22, 0x36, 0x20, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x4e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x53, 0x45, 0x45, 0x52, - 0x2a, 0x53, 0x74, 0x61, 0x74, 0x20, 0x44, 0x61, 0x74, 0x61, - 0x62, 0x61, 0x73, 0x65, 0x20, 0x2d, 0x20, 0x55, 0x6e, 0x69, - 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, - 0x20, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x48, 0x75, 0x6d, 0x61, - 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2c, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, - 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x62, 0x61, 0x73, 0x65, - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, - 0x30, 0x32, 0x32, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x2e, 0x20, 0x20, 0x5b, 0x20, - 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x63, 0x64, 0x63, 0x2e, 0x67, 0x6f, 0x76, 0x2f, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2f, 0x6e, 0x70, 0x63, - 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, - 0x6d, 0x20, 0x5d, 0x22, 0x0a, 0x22, 0x38, 0x20, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x63, 0x69, - 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, - 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, - 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x45, 0x45, - 0x52, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, - 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, - 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x20, 0x29, 0x20, 0x41, 0x41, - 0x50, 0x43, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x61, - 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, - 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x6f, 0x69, 0x6e, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x75, 0x72, 0x76, 0x65, - 0x69, 0x6c, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x63, 0x61, - 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x6a, - 0x6f, 0x69, 0x6e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x20, - 0x29, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, - 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, - 0x50, 0x43, 0x73, 0x2e, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, - 0x61, 0x72, 0x65, 0x20, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x64, - 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, 0x30, 0x30, 0x20, 0x55, - 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, - 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, 0x65, 0x72, 0x2e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, - 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6e, 0x67, - 0x6c, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x2e, 0x68, 0x74, 0x6d, - 0x6c, 0x20, 0x29, 0x20, 0x28, 0x31, 0x39, 0x20, 0x61, 0x67, - 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x20, - 0x3c, 0x31, 0x2c, 0x20, 0x31, 0x2d, 0x34, 0x2c, 0x20, 0x35, - 0x2d, 0x39, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x2c, 0x20, - 0x38, 0x30, 0x2d, 0x38, 0x34, 0x2c, 0x38, 0x35, 0x2b, 0x29, - 0x2e, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x72, - 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x61, - 0x73, 0x69, 0x76, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x28, 0x65, 0x78, - 0x63, 0x65, 0x70, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, - 0x6c, 0x61, 0x64, 0x64, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, - 0x69, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, - 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x73, - 0x69, 0x74, 0x75, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x75, 0x6e, - 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x77, 0x69, 0x73, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, - 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, - 0x66, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, - 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x20, 0x50, - 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x44, 0x61, 0x74, 0x61, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, - 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x20, 0x29, - 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x75, - 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x53, - 0x45, 0x45, 0x52, 0x20, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x20, 0x32, 0x30, 0x32, 0x32, 0x20, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x20, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x55, - 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, - 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, - 0x4e, 0x65, 0x76, 0x61, 0x64, 0x61, 0x2e, 0x0a, 0x44, 0x61, - 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, - 0x69, 0x63, 0x6f, 0x2e, 0x0a)), request = structure(list( - url = "https://statecancerprofiles.cancer.gov/incidencerates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&stage=999&year=0&type=incd&sortVariableName=rate&sortOrder=default&output=1&sex=0", - method = NULL, headers = list(), body = NULL, fields = list(), - options = list(), policies = list()), class = "httr2_request"), - cache = new.env()), class = "httr2_response") + resp <- structure(list( + method = "GET", url = "https://statecancerprofiles.cancer.gov/incidencerates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&stage=999&year=0&type=incd&sortVariableName=rate&sortOrder=default&output=1&sex=0", + status_code = 200L, headers = structure(list( + date = "Wed, 21 Feb 2024 19:21:05 GMT", + server = "Apache", `content-disposition` = "attachment; filename=\"incd.csv\"", + `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", + `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", + `set-cookie` = "TKTID=web-dmzst-03; path=/; HttpOnly; Secure", + `cache-control` = "private" + ), class = "httr2_headers"), + body = as.raw(c( + 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x20, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, + 0x65, 0x6c, 0x61, 0x77, 0x61, 0x72, 0x65, 0x20, 0x62, 0x79, + 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x0a, 0x0a, 0x22, + 0x41, 0x6c, 0x6c, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, + 0x20, 0x53, 0x69, 0x74, 0x65, 0x73, 0x20, 0x28, 0x41, 0x6c, + 0x6c, 0x20, 0x53, 0x74, 0x61, 0x67, 0x65, 0x73, 0x5e, 0x29, + 0x2c, 0x20, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x32, 0x30, 0x32, + 0x30, 0x22, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, 0x52, + 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, 0x69, 0x73, 0x70, 0x61, + 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, 0x42, 0x6f, 0x74, 0x68, + 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, 0x2c, 0x20, 0x41, 0x67, + 0x65, 0x73, 0x20, 0x36, 0x35, 0x2b, 0x22, 0x0a, 0x0a, 0x53, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x52, + 0x61, 0x74, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, 0x22, 0x41, + 0x67, 0x65, 0x2d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, + 0x64, 0x20, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x28, 0x5b, 0x72, 0x61, + 0x74, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, + 0x2d, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x70, 0x65, + 0x72, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x30, 0x22, + 0x2c, 0x22, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x39, 0x35, + 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x22, 0x2c, 0x22, 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, + 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x43, 0x49, 0x2a, 0x52, + 0x61, 0x6e, 0x6b, 0x28, 0x5b, 0x72, 0x61, 0x6e, 0x6b, 0x20, + 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x22, 0x2c, 0x22, 0x4c, + 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x43, + 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, 0x22, + 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, + 0x43, 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, + 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x2c, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x72, + 0x65, 0x6e, 0x64, 0x2c, 0x22, 0x52, 0x65, 0x63, 0x65, 0x6e, + 0x74, 0x20, 0x35, 0x2d, 0x59, 0x65, 0x61, 0x72, 0x20, 0x54, + 0x72, 0x65, 0x6e, 0x64, 0x20, 0x28, 0x5b, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, + 0x69, 0x6e, 0x20, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, + 0x22, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, + 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x22, 0x2c, 0x22, 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x39, + 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, + 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x22, 0x0a, 0x22, 0x44, 0x65, 0x6c, 0x61, 0x77, + 0x61, 0x72, 0x65, 0x28, 0x36, 0x29, 0x22, 0x2c, 0x31, 0x30, + 0x30, 0x30, 0x30, 0x2c, 0x31, 0x39, 0x39, 0x35, 0x2e, 0x38, + 0x20, 0x2c, 0x31, 0x39, 0x36, 0x36, 0x2e, 0x32, 0x2c, 0x20, + 0x32, 0x30, 0x32, 0x35, 0x2e, 0x37, 0x2c, 0x4e, 0x2f, 0x41, + 0x20, 0x2c, 0x20, 0x31, 0x34, 0x20, 0x2c, 0x20, 0x33, 0x32, + 0x2c, 0x33, 0x35, 0x36, 0x37, 0x2c, 0x66, 0x61, 0x6c, 0x6c, + 0x69, 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x34, 0x20, 0x2c, + 0x2d, 0x32, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, + 0x0a, 0x22, 0x55, 0x53, 0x20, 0x28, 0x53, 0x45, 0x45, 0x52, + 0x2b, 0x4e, 0x50, 0x43, 0x52, 0x29, 0x28, 0x31, 0x29, 0x22, + 0x2c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x31, 0x39, 0x34, + 0x34, 0x2e, 0x34, 0x20, 0x2c, 0x31, 0x39, 0x34, 0x32, 0x2e, + 0x36, 0x2c, 0x20, 0x31, 0x39, 0x34, 0x36, 0x2e, 0x31, 0x2c, + 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x20, + 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x2c, 0x39, 0x37, 0x31, 0x38, + 0x32, 0x38, 0x2c, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c, + 0x2d, 0x30, 0x2e, 0x35, 0x20, 0x2c, 0x2d, 0x30, 0x2e, 0x38, + 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x0a, 0x22, 0x4b, 0x65, 0x6e, + 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x28, 0x36, + 0x29, 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x31, 0x2c, 0x32, + 0x30, 0x39, 0x32, 0x2e, 0x38, 0x20, 0x2c, 0x32, 0x30, 0x32, + 0x30, 0x2c, 0x20, 0x32, 0x31, 0x36, 0x37, 0x2e, 0x35, 0x2c, + 0x31, 0x20, 0x2c, 0x20, 0x31, 0x20, 0x2c, 0x20, 0x31, 0x2c, + 0x36, 0x33, 0x36, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, + 0x67, 0x2c, 0x2d, 0x32, 0x2e, 0x30, 0x20, 0x2c, 0x2d, 0x32, + 0x2e, 0x37, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x34, 0x0a, 0x22, + 0x4e, 0x65, 0x77, 0x20, 0x43, 0x61, 0x73, 0x74, 0x6c, 0x65, + 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x28, 0x36, 0x29, + 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x33, 0x2c, 0x31, 0x39, + 0x39, 0x38, 0x20, 0x2c, 0x31, 0x39, 0x35, 0x35, 0x2e, 0x34, + 0x2c, 0x20, 0x32, 0x30, 0x34, 0x31, 0x2e, 0x32, 0x2c, 0x32, + 0x20, 0x2c, 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x31, + 0x37, 0x31, 0x34, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, + 0x67, 0x2c, 0x2d, 0x30, 0x2e, 0x39, 0x20, 0x2c, 0x2d, 0x31, + 0x2e, 0x34, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x34, 0x0a, 0x22, + 0x53, 0x75, 0x73, 0x73, 0x65, 0x78, 0x20, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x79, 0x28, 0x36, 0x29, 0x22, 0x2c, 0x31, 0x30, + 0x30, 0x30, 0x35, 0x2c, 0x31, 0x39, 0x34, 0x36, 0x2e, 0x39, + 0x20, 0x2c, 0x31, 0x38, 0x39, 0x37, 0x2e, 0x32, 0x2c, 0x20, + 0x31, 0x39, 0x39, 0x37, 0x2e, 0x36, 0x2c, 0x33, 0x20, 0x2c, + 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x31, 0x32, 0x31, + 0x36, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, + 0x2d, 0x33, 0x2e, 0x31, 0x20, 0x2c, 0x2d, 0x35, 0x2e, 0x39, + 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x20, + 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, 0x31, 0x2f, 0x32, + 0x30, 0x32, 0x34, 0x20, 0x32, 0x3a, 0x32, 0x31, 0x20, 0x70, + 0x6d, 0x2e, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6d, 0x61, + 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, + 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, + 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x0a, 0x0a, 0x0a, 0x54, 0x72, 0x65, 0x6e, 0x64, + 0x0a, 0x20, 0x20, 0x20, 0x52, 0x69, 0x73, 0x69, 0x6e, 0x67, + 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, + 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, + 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x76, + 0x65, 0x20, 0x30, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x53, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, + 0x39, 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, + 0x6c, 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x30, 0x2e, 0x0a, 0x20, + 0x20, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, + 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x6f, + 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, + 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, + 0x20, 0x30, 0x2e, 0x0a, 0x0a, 0x22, 0x5b, 0x72, 0x61, 0x74, + 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x20, 0x49, 0x6e, + 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x72, 0x61, + 0x74, 0x65, 0x73, 0x20, 0x28, 0x63, 0x61, 0x73, 0x65, 0x73, + 0x20, 0x70, 0x65, 0x72, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x30, + 0x30, 0x30, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x20, 0x79, 0x65, + 0x61, 0x72, 0x29, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x67, + 0x65, 0x2d, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, + 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, + 0x30, 0x30, 0x20, 0x55, 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, + 0x64, 0x61, 0x72, 0x64, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x68, 0x74, 0x74, + 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, + 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, + 0x67, 0x6f, 0x76, 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, + 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, + 0x74, 0x64, 0x70, 0x6f, 0x70, 0x2e, 0x31, 0x39, 0x61, 0x67, + 0x65, 0x73, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x5d, 0x20, 0x28, + 0x31, 0x39, 0x20, 0x61, 0x67, 0x65, 0x20, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x3a, 0x20, 0x3c, 0x31, 0x2c, 0x20, 0x31, + 0x2d, 0x34, 0x2c, 0x20, 0x35, 0x2d, 0x39, 0x2c, 0x20, 0x2e, + 0x2e, 0x2e, 0x20, 0x2c, 0x20, 0x38, 0x30, 0x2d, 0x38, 0x34, + 0x2c, 0x20, 0x38, 0x35, 0x2b, 0x29, 0x2e, 0x20, 0x52, 0x61, + 0x74, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, + 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x6f, 0x6e, + 0x6c, 0x79, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, 0x6c, 0x61, 0x64, 0x64, + 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, + 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x69, + 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x69, 0x74, 0x75, 0x29, + 0x20, 0x6f, 0x72, 0x20, 0x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, + 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, + 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x2e, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x20, 0x63, 0x61, + 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x75, + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, + 0x53, 0x74, 0x61, 0x74, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, + 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, + 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x5d, 0x20, + 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, 0x2e, 0x20, 0x54, 0x68, + 0x65, 0x20, 0x55, 0x53, 0x20, 0x50, 0x6f, 0x70, 0x75, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x61, 0x74, 0x61, + 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x5b, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, + 0x2f, 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x5d, + 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x53, 0x45, 0x45, 0x52, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x4e, 0x50, 0x43, 0x52, 0x20, 0x69, 0x6e, 0x63, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x72, 0x61, 0x74, + 0x65, 0x73, 0x2e, 0x22, 0x0a, 0x22, 0x5b, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x20, 0x49, + 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x64, + 0x61, 0x74, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x66, + 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, + 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, + 0x79, 0x65, 0x61, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x64, + 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x6d, 0x6f, + 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x74, 0x72, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, + 0x20, 0x41, 0x41, 0x50, 0x43, 0x73, 0x20, 0x62, 0x61, 0x73, + 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x50, 0x43, 0x73, + 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, + 0x61, 0x72, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, 0x20, 0x63, + 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, + 0x69, 0x6e, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, 0x53, 0x74, + 0x61, 0x74, 0x2e, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, + 0x61, 0x72, 0x65, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, + 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, + 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x22, 0x0a, 0x0a, 0x52, 0x61, 0x74, 0x65, 0x73, + 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x72, 0x65, 0x6e, 0x64, + 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, + 0x75, 0x74, 0x65, 0x64, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, + 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, + 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x6c, 0x69, 0x67, + 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x2e, 0x20, 0x46, 0x6f, 0x72, + 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x65, + 0x65, 0x20, 0x6d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x6e, + 0x74, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x2e, 0x0a, 0x0a, 0x22, + 0x5e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x67, + 0x65, 0x73, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, + 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x73, 0x74, 0x61, + 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x53, 0x75, 0x72, 0x76, 0x65, 0x69, 0x6c, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x2c, 0x20, 0x45, 0x70, 0x69, 0x64, 0x65, 0x6d, + 0x69, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2c, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x45, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x20, 0x28, 0x53, 0x45, 0x45, 0x52, 0x29, + 0x20, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x73, + 0x74, 0x61, 0x67, 0x65, 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, + 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x73, 0x73, 0x6d, + 0x2f, 0x20, 0x5d, 0x2e, 0x22, 0x0a, 0x22, 0x5b, 0x72, 0x61, + 0x6e, 0x6b, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, + 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, 0x52, 0x61, + 0x6e, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x20, 0x73, + 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, + 0x65, 0x66, 0x75, 0x6c, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x2e, 0x20, 0x46, + 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2c, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x6c, 0x79, 0x20, 0x72, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, + 0x73, 0x65, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6f, 0x72, 0x20, + 0x6c, 0x65, 0x73, 0x73, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x61, 0x73, + 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x65, 0x73, + 0x73, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x20, + 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x73, + 0x73, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x6c, + 0x61, 0x72, 0x67, 0x65, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x62, 0x75, + 0x74, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x20, 0x64, 0x69, 0x73, 0x65, 0x61, 0x73, + 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, 0x6e, 0x73, + 0x65, 0x6c, 0x79, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x76, + 0x65, 0x72, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, + 0x2e, 0x20, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, + 0x62, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x20, 0x63, 0x61, 0x6e, + 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, + 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, + 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x2e, 0x22, 0x0a, 0x0a, 0x22, 0x31, 0x20, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x4e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, + 0x64, 0x63, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x72, 0x2f, 0x6e, 0x70, 0x63, 0x72, 0x2f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x5d, + 0x20, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, + 0x69, 0x6c, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x45, + 0x70, 0x69, 0x64, 0x65, 0x6d, 0x69, 0x6f, 0x6c, 0x6f, 0x67, + 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6e, 0x64, + 0x20, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x5b, + 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x65, + 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, + 0x67, 0x6f, 0x76, 0x20, 0x5d, 0x20, 0x53, 0x45, 0x45, 0x52, + 0x2a, 0x53, 0x74, 0x61, 0x74, 0x20, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x20, 0x2d, 0x20, 0x55, 0x6e, 0x69, + 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, + 0x20, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x48, 0x75, 0x6d, 0x61, + 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2c, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, + 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x4e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, + 0x74, 0x75, 0x74, 0x65, 0x2e, 0x20, 0x42, 0x61, 0x73, 0x65, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, + 0x30, 0x32, 0x32, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x0a, 0x22, 0x36, 0x20, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x4e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x53, 0x45, 0x45, 0x52, + 0x2a, 0x53, 0x74, 0x61, 0x74, 0x20, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x20, 0x2d, 0x20, 0x55, 0x6e, 0x69, + 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, + 0x20, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x48, 0x75, 0x6d, 0x61, + 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2c, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, + 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x62, 0x61, 0x73, 0x65, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x32, + 0x30, 0x32, 0x32, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x2e, 0x20, 0x20, 0x5b, 0x20, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, + 0x77, 0x2e, 0x63, 0x64, 0x63, 0x2e, 0x67, 0x6f, 0x76, 0x2f, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2f, 0x6e, 0x70, 0x63, + 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, + 0x6d, 0x20, 0x5d, 0x22, 0x0a, 0x22, 0x38, 0x20, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x49, 0x6e, 0x63, 0x69, + 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, + 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, + 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x45, 0x45, + 0x52, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, + 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, + 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x20, 0x29, 0x20, 0x41, 0x41, + 0x50, 0x43, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x61, + 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, + 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x6f, 0x69, 0x6e, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x75, 0x72, 0x76, 0x65, + 0x69, 0x6c, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x6a, + 0x6f, 0x69, 0x6e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x20, + 0x29, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, + 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, + 0x50, 0x43, 0x73, 0x2e, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, + 0x61, 0x72, 0x65, 0x20, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x64, + 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, 0x30, 0x30, 0x20, 0x55, + 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, + 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, + 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, 0x65, 0x72, 0x2e, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, + 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x2e, 0x68, 0x74, 0x6d, + 0x6c, 0x20, 0x29, 0x20, 0x28, 0x31, 0x39, 0x20, 0x61, 0x67, + 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x20, + 0x3c, 0x31, 0x2c, 0x20, 0x31, 0x2d, 0x34, 0x2c, 0x20, 0x35, + 0x2d, 0x39, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x2c, 0x20, + 0x38, 0x30, 0x2d, 0x38, 0x34, 0x2c, 0x38, 0x35, 0x2b, 0x29, + 0x2e, 0x20, 0x52, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, 0x72, + 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x61, + 0x73, 0x69, 0x76, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x72, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x28, 0x65, 0x78, + 0x63, 0x65, 0x70, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, + 0x6c, 0x61, 0x64, 0x64, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x72, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, + 0x69, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x73, 0x69, 0x76, + 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x73, + 0x69, 0x74, 0x75, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x75, 0x6e, + 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x77, 0x69, 0x73, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, + 0x20, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, + 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x20, 0x50, + 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x44, 0x61, 0x74, 0x61, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, + 0x70, 0x6f, 0x70, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x20, 0x29, + 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x75, + 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x53, + 0x45, 0x45, 0x52, 0x20, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x20, 0x32, 0x30, 0x32, 0x32, 0x20, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x20, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x55, + 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, + 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, + 0x4e, 0x65, 0x76, 0x61, 0x64, 0x61, 0x2e, 0x0a, 0x44, 0x61, + 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, + 0x69, 0x63, 0x6f, 0x2e, 0x0a + )), request = structure(list( + url = "https://statecancerprofiles.cancer.gov/incidencerates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&stage=999&year=0&type=incd&sortVariableName=rate&sortOrder=default&output=1&sex=0", + method = NULL, headers = list(), body = NULL, fields = list(), + options = list(), policies = list() + ), class = "httr2_request"), + cache = new.env() + ), class = "httr2_response") } - - - diff --git a/R/test-dput-resp-mortality.R b/R/test-dput-resp-mortality.R index 354b111..8c3ed9d 100644 --- a/R/test-dput-resp-mortality.R +++ b/R/test-dput-resp-mortality.R @@ -1,342 +1,349 @@ #' Test dput-resp-mortality -#' +#' #' This function creates a response object from the Mortality section of State Cancer Profiles for #' -#' +#' #' @returns A httr2 response object -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' dput_resp_mortality() #' } dput_resp_mortality <- function() { - resp <- structure(list(method = "GET", url = "https://statecancerprofiles.cancer.gov/deathrates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&year=0&type=death&sortVariableName=rate&sortOrder=default&output=1&sex=0", - status_code = 200L, headers = structure(list(date = "Wed, 21 Feb 2024 19:51:18 GMT", - server = "Apache", `content-disposition` = "attachment; filename=\"death.csv\"", - `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", - `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", - `set-cookie` = "TKTID=web-dmzst-02; path=/; HttpOnly; Secure", - `cache-control` = "private"), class = "httr2_headers"), - body = as.raw(c(0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, - 0x61, 0x74, 0x65, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, 0x65, 0x6c, 0x61, 0x77, - 0x61, 0x72, 0x65, 0x20, 0x62, 0x79, 0x20, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x79, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x53, 0x69, 0x74, - 0x65, 0x73, 0x2c, 0x20, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x32, - 0x30, 0x32, 0x30, 0x22, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, - 0x20, 0x52, 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, 0x69, 0x73, - 0x70, 0x61, 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, 0x42, 0x6f, - 0x74, 0x68, 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, 0x2c, 0x20, - 0x41, 0x67, 0x65, 0x73, 0x20, 0x36, 0x35, 0x2b, 0x22, 0x0a, - 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, - 0x20, 0x52, 0x61, 0x74, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, - 0x4d, 0x65, 0x74, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6f, - 0x66, 0x20, 0x31, 0x32, 0x32, 0x2e, 0x37, 0x3f, 0x2c, 0x22, - 0x41, 0x67, 0x65, 0x2d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, - 0x65, 0x64, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, - 0x61, 0x74, 0x65, 0x28, 0x5b, 0x72, 0x61, 0x74, 0x65, 0x20, - 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, 0x2d, 0x20, 0x64, - 0x65, 0x61, 0x74, 0x68, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, - 0x31, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, - 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, - 0x52, 0x61, 0x74, 0x65, 0x29, 0x22, 0x2c, 0x22, 0x55, 0x70, - 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x52, 0x61, - 0x74, 0x65, 0x29, 0x22, 0x2c, 0x22, 0x43, 0x49, 0x2a, 0x52, - 0x61, 0x6e, 0x6b, 0x28, 0x5b, 0x72, 0x61, 0x6e, 0x6b, 0x20, - 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x22, 0x2c, 0x22, 0x4c, - 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x43, - 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, 0x22, - 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, - 0x43, 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, - 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x2c, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x72, - 0x65, 0x6e, 0x64, 0x2c, 0x22, 0x52, 0x65, 0x63, 0x65, 0x6e, - 0x74, 0x20, 0x35, 0x2d, 0x59, 0x65, 0x61, 0x72, 0x20, 0x54, - 0x72, 0x65, 0x6e, 0x64, 0x20, 0x28, 0x5b, 0x74, 0x72, 0x65, - 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, - 0x69, 0x6e, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, - 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, 0x22, 0x4c, 0x6f, 0x77, - 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x55, - 0x70, 0x70, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x0a, - 0x22, 0x44, 0x65, 0x6c, 0x61, 0x77, 0x61, 0x72, 0x65, 0x22, - 0x2c, 0x31, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x4e, 0x6f, 0x2c, - 0x39, 0x30, 0x37, 0x2e, 0x39, 0x20, 0x2c, 0x38, 0x38, 0x37, - 0x2e, 0x36, 0x2c, 0x20, 0x39, 0x32, 0x38, 0x2e, 0x36, 0x2c, - 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, 0x37, 0x20, 0x2c, 0x20, - 0x32, 0x37, 0x2c, 0x31, 0x35, 0x35, 0x34, 0x2c, 0x66, 0x61, - 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x35, - 0x20, 0x2c, 0x2d, 0x31, 0x2e, 0x36, 0x2c, 0x20, 0x2d, 0x31, - 0x2e, 0x33, 0x0a, 0x22, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, - 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x2c, 0x4e, 0x6f, 0x2c, 0x38, 0x35, - 0x35, 0x2e, 0x34, 0x20, 0x2c, 0x38, 0x35, 0x34, 0x2e, 0x32, - 0x2c, 0x20, 0x38, 0x35, 0x36, 0x2e, 0x35, 0x2c, 0x4e, 0x2f, - 0x41, 0x20, 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, - 0x4e, 0x2f, 0x41, 0x2c, 0x34, 0x33, 0x31, 0x36, 0x32, 0x38, - 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, - 0x32, 0x2e, 0x30, 0x20, 0x2c, 0x2d, 0x32, 0x2e, 0x32, 0x2c, - 0x20, 0x2d, 0x31, 0x2e, 0x37, 0x0a, 0x22, 0x4b, 0x65, 0x6e, - 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, - 0x31, 0x30, 0x30, 0x30, 0x31, 0x2c, 0x4e, 0x6f, 0x2c, 0x39, - 0x32, 0x35, 0x2e, 0x37, 0x20, 0x2c, 0x38, 0x37, 0x36, 0x2e, - 0x35, 0x2c, 0x20, 0x39, 0x37, 0x36, 0x2e, 0x39, 0x2c, 0x31, - 0x20, 0x2c, 0x20, 0x31, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x32, - 0x37, 0x30, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, - 0x2c, 0x2d, 0x31, 0x2e, 0x32, 0x20, 0x2c, 0x2d, 0x31, 0x2e, - 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x39, 0x0a, 0x22, 0x4e, - 0x65, 0x77, 0x20, 0x43, 0x61, 0x73, 0x74, 0x6c, 0x65, 0x20, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x31, 0x30, - 0x30, 0x30, 0x33, 0x2c, 0x4e, 0x6f, 0x2c, 0x39, 0x32, 0x32, - 0x2e, 0x37, 0x20, 0x2c, 0x38, 0x39, 0x33, 0x2e, 0x35, 0x2c, - 0x20, 0x39, 0x35, 0x32, 0x2e, 0x36, 0x2c, 0x32, 0x20, 0x2c, - 0x20, 0x31, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x37, 0x37, 0x31, - 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, - 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x2d, 0x31, 0x2e, 0x37, 0x2c, - 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, 0x22, 0x53, 0x75, 0x73, - 0x73, 0x65, 0x78, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, - 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x35, 0x2c, 0x4e, 0x6f, - 0x2c, 0x38, 0x38, 0x32, 0x2e, 0x31, 0x20, 0x2c, 0x38, 0x34, - 0x37, 0x2e, 0x37, 0x2c, 0x20, 0x39, 0x31, 0x37, 0x2e, 0x36, - 0x2c, 0x33, 0x20, 0x2c, 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, - 0x2c, 0x35, 0x31, 0x34, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, - 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x2d, - 0x31, 0x2e, 0x37, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, - 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, - 0x79, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, - 0x6f, 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, - 0x31, 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x32, 0x3a, 0x35, - 0x31, 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x0a, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x20, 0x6d, 0x61, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6d, - 0x6f, 0x72, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x0a, 0x0a, 0x0a, 0x54, 0x72, - 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x52, 0x69, 0x73, - 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, - 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, - 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, - 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, - 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, - 0x62, 0x6f, 0x76, 0x65, 0x20, 0x30, 0x2e, 0x0a, 0x20, 0x20, - 0x20, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x68, - 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, - 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, - 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x30, - 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x69, - 0x6e, 0x67, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, - 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, - 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, - 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, - 0x6c, 0x6f, 0x77, 0x20, 0x30, 0x2e, 0x0a, 0x0a, 0x22, 0x5b, - 0x72, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, - 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x64, 0x61, 0x74, 0x61, - 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, - 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x69, 0x74, 0x61, - 0x6c, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, - 0x63, 0x73, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x75, 0x73, 0x65, - 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, - 0x2e, 0x20, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x72, - 0x61, 0x74, 0x65, 0x73, 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x49, - 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x75, - 0x73, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, - 0x53, 0x74, 0x61, 0x74, 0x2e, 0x20, 0x20, 0x44, 0x65, 0x61, - 0x74, 0x68, 0x20, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, - 0x72, 0x65, 0x20, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x20, 0x74, 0x6f, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, 0x30, 0x30, 0x20, 0x55, - 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, - 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, - 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, - 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, - 0x70, 0x2e, 0x31, 0x39, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x68, - 0x74, 0x6d, 0x6c, 0x5d, 0x20, 0x28, 0x31, 0x39, 0x20, 0x61, - 0x67, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, - 0x20, 0x3c, 0x31, 0x2c, 0x20, 0x31, 0x2d, 0x34, 0x2c, 0x20, - 0x35, 0x2d, 0x39, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x2c, - 0x20, 0x38, 0x30, 0x2d, 0x38, 0x34, 0x2c, 0x20, 0x38, 0x35, - 0x2b, 0x29, 0x2e, 0x54, 0x68, 0x65, 0x20, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, - 0x65, 0x20, 0x32, 0x30, 0x33, 0x30, 0x20, 0x67, 0x6f, 0x61, - 0x6c, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, - 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x74, 0x65, - 0x73, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, - 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x69, 0x66, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x73, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, - 0x64, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, - 0x61, 0x6c, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, - 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, - 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x20, 0x70, - 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, 0x2e, - 0x20, 0x22, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x20, - 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, 0x46, 0x69, 0x6c, 0x65, - 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x70, 0x6f, 0x70, 0x64, - 0x61, 0x74, 0x61, 0x2f, 0x5d, 0x20, 0x69, 0x73, 0x20, 0x75, - 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6d, - 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x20, 0x0a, 0x22, 0x5b, 0x74, 0x72, - 0x65, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x54, - 0x68, 0x65, 0x20, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x20, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x50, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x20, 0x28, 0x41, 0x41, 0x50, 0x43, 0x29, 0x20, - 0x69, 0x73, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, - 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, - 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x6f, 0x69, 0x6e, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, - 0x74, 0x6f, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x2c, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, - 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x61, 0x6c, - 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, - 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6a, 0x6f, 0x69, 0x6e, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x64, 0x69, 0x66, - 0x66, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x22, 0x0a, 0x22, 0x5b, - 0x72, 0x61, 0x6e, 0x6b, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x70, 0x72, - 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, - 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, - 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x73, 0x20, 0x68, 0x65, 0x6c, 0x70, - 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x6e, 0x65, 0x73, 0x73, - 0x20, 0x6f, 0x66, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x2e, - 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2c, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x6c, 0x79, 0x20, 0x72, 0x61, 0x72, 0x65, 0x20, - 0x64, 0x69, 0x73, 0x65, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6f, - 0x72, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x70, 0x6f, 0x70, - 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, - 0x61, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, - 0x65, 0x73, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, - 0x79, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x73, 0x73, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, - 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, - 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x76, 0x61, 0x72, - 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, - 0x62, 0x75, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x64, 0x69, 0x73, 0x65, - 0x61, 0x73, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, - 0x6e, 0x73, 0x65, 0x6c, 0x79, 0x20, 0x70, 0x6f, 0x70, 0x75, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, - 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, - 0x75, 0x6c, 0x2e, 0x20, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x69, - 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x20, 0x63, - 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, - 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x65, 0x62, - 0x73, 0x69, 0x74, 0x65, 0x2e, 0x22, 0x0a, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, - 0x65, 0x20, 0x32, 0x30, 0x33, 0x30, 0x20, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x5b, 0x20, - 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x70, - 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2f, - 0x20, 0x5d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x65, - 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, 0x65, 0x20, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x61, 0x6e, 0x64, 0x20, - 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x64, 0x63, 0x2e, 0x67, - 0x6f, 0x76, 0x20, 0x5d, 0x2e, 0x20, 0x0a, 0x0a, 0x0a, 0x22, - 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x6e, 0x6f, 0x74, - 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x65, - 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x66, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, - 0x74, 0x6f, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x74, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x20, 0x28, - 0x20, 0x2f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x2f, 0x64, 0x69, - 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, - 0x68, 0x74, 0x6d, 0x6c, 0x20, 0x29, 0x20, 0x6f, 0x66, 0x20, - 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x6d, - 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x72, - 0x65, 0x20, 0x41, 0x41, 0x50, 0x43, 0x73, 0x20, 0x62, 0x61, - 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x50, 0x43, - 0x73, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x6f, 0x6d, 0x65, - 0x20, 0x61, 0x72, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, 0x20, - 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, - 0x20, 0x69, 0x6e, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, 0x53, - 0x74, 0x61, 0x74, 0x2e, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, - 0x2f, 0x73, 0x65, 0x65, 0x72, 0x73, 0x74, 0x61, 0x74, 0x2f, - 0x20, 0x29, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x67, - 0x72, 0x61, 0x70, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, - 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, - 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x20, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, - 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, - 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, - 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, 0x2e, 0x0a)), request = structure(list( - url = "https://statecancerprofiles.cancer.gov/deathrates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&year=0&type=death&sortVariableName=rate&sortOrder=default&output=1&sex=0", - method = NULL, headers = list(), body = NULL, fields = list(), - options = list(), policies = list()), class = "httr2_request"), - cache = new.env()), class = "httr2_response") + resp <- structure(list( + method = "GET", url = "https://statecancerprofiles.cancer.gov/deathrates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&year=0&type=death&sortVariableName=rate&sortOrder=default&output=1&sex=0", + status_code = 200L, headers = structure(list( + date = "Wed, 21 Feb 2024 19:51:18 GMT", + server = "Apache", `content-disposition` = "attachment; filename=\"death.csv\"", + `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", + `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", + `set-cookie` = "TKTID=web-dmzst-02; path=/; HttpOnly; Secure", + `cache-control` = "private" + ), class = "httr2_headers"), + body = as.raw(c( + 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, + 0x61, 0x74, 0x65, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, 0x65, 0x6c, 0x61, 0x77, + 0x61, 0x72, 0x65, 0x20, 0x62, 0x79, 0x20, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x79, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x53, 0x69, 0x74, + 0x65, 0x73, 0x2c, 0x20, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x32, + 0x30, 0x32, 0x30, 0x22, 0x0a, 0x0a, 0x22, 0x41, 0x6c, 0x6c, + 0x20, 0x52, 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, 0x69, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, 0x69, 0x73, + 0x70, 0x61, 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, 0x42, 0x6f, + 0x74, 0x68, 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, 0x2c, 0x20, + 0x41, 0x67, 0x65, 0x73, 0x20, 0x36, 0x35, 0x2b, 0x22, 0x0a, + 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, + 0x20, 0x52, 0x61, 0x74, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, + 0x4d, 0x65, 0x74, 0x20, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6f, + 0x66, 0x20, 0x31, 0x32, 0x32, 0x2e, 0x37, 0x3f, 0x2c, 0x22, + 0x41, 0x67, 0x65, 0x2d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, + 0x65, 0x64, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, + 0x61, 0x74, 0x65, 0x28, 0x5b, 0x72, 0x61, 0x74, 0x65, 0x20, + 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, 0x2d, 0x20, 0x64, + 0x65, 0x61, 0x74, 0x68, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, + 0x31, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, + 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, + 0x52, 0x61, 0x74, 0x65, 0x29, 0x22, 0x2c, 0x22, 0x55, 0x70, + 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x52, 0x61, + 0x74, 0x65, 0x29, 0x22, 0x2c, 0x22, 0x43, 0x49, 0x2a, 0x52, + 0x61, 0x6e, 0x6b, 0x28, 0x5b, 0x72, 0x61, 0x6e, 0x6b, 0x20, + 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x22, 0x2c, 0x22, 0x4c, + 0x6f, 0x77, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, 0x43, + 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, 0x22, + 0x55, 0x70, 0x70, 0x65, 0x72, 0x20, 0x43, 0x49, 0x20, 0x28, + 0x43, 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x29, 0x22, 0x2c, + 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x2c, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x72, + 0x65, 0x6e, 0x64, 0x2c, 0x22, 0x52, 0x65, 0x63, 0x65, 0x6e, + 0x74, 0x20, 0x35, 0x2d, 0x59, 0x65, 0x61, 0x72, 0x20, 0x54, + 0x72, 0x65, 0x6e, 0x64, 0x20, 0x28, 0x5b, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x29, 0x20, + 0x69, 0x6e, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x52, + 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, 0x22, 0x4c, 0x6f, 0x77, + 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x55, + 0x70, 0x70, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x0a, + 0x22, 0x44, 0x65, 0x6c, 0x61, 0x77, 0x61, 0x72, 0x65, 0x22, + 0x2c, 0x31, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x4e, 0x6f, 0x2c, + 0x39, 0x30, 0x37, 0x2e, 0x39, 0x20, 0x2c, 0x38, 0x38, 0x37, + 0x2e, 0x36, 0x2c, 0x20, 0x39, 0x32, 0x38, 0x2e, 0x36, 0x2c, + 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, 0x37, 0x20, 0x2c, 0x20, + 0x32, 0x37, 0x2c, 0x31, 0x35, 0x35, 0x34, 0x2c, 0x66, 0x61, + 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x35, + 0x20, 0x2c, 0x2d, 0x31, 0x2e, 0x36, 0x2c, 0x20, 0x2d, 0x31, + 0x2e, 0x33, 0x0a, 0x22, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, + 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x22, 0x2c, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x2c, 0x4e, 0x6f, 0x2c, 0x38, 0x35, + 0x35, 0x2e, 0x34, 0x20, 0x2c, 0x38, 0x35, 0x34, 0x2e, 0x32, + 0x2c, 0x20, 0x38, 0x35, 0x36, 0x2e, 0x35, 0x2c, 0x4e, 0x2f, + 0x41, 0x20, 0x2c, 0x20, 0x4e, 0x2f, 0x41, 0x20, 0x2c, 0x20, + 0x4e, 0x2f, 0x41, 0x2c, 0x34, 0x33, 0x31, 0x36, 0x32, 0x38, + 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, + 0x32, 0x2e, 0x30, 0x20, 0x2c, 0x2d, 0x32, 0x2e, 0x32, 0x2c, + 0x20, 0x2d, 0x31, 0x2e, 0x37, 0x0a, 0x22, 0x4b, 0x65, 0x6e, + 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, + 0x31, 0x30, 0x30, 0x30, 0x31, 0x2c, 0x4e, 0x6f, 0x2c, 0x39, + 0x32, 0x35, 0x2e, 0x37, 0x20, 0x2c, 0x38, 0x37, 0x36, 0x2e, + 0x35, 0x2c, 0x20, 0x39, 0x37, 0x36, 0x2e, 0x39, 0x2c, 0x31, + 0x20, 0x2c, 0x20, 0x31, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x32, + 0x37, 0x30, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, + 0x2c, 0x2d, 0x31, 0x2e, 0x32, 0x20, 0x2c, 0x2d, 0x31, 0x2e, + 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x39, 0x0a, 0x22, 0x4e, + 0x65, 0x77, 0x20, 0x43, 0x61, 0x73, 0x74, 0x6c, 0x65, 0x20, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x31, 0x30, + 0x30, 0x30, 0x33, 0x2c, 0x4e, 0x6f, 0x2c, 0x39, 0x32, 0x32, + 0x2e, 0x37, 0x20, 0x2c, 0x38, 0x39, 0x33, 0x2e, 0x35, 0x2c, + 0x20, 0x39, 0x35, 0x32, 0x2e, 0x36, 0x2c, 0x32, 0x20, 0x2c, + 0x20, 0x31, 0x20, 0x2c, 0x20, 0x33, 0x2c, 0x37, 0x37, 0x31, + 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x2c, 0x2d, + 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x2d, 0x31, 0x2e, 0x37, 0x2c, + 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, 0x22, 0x53, 0x75, 0x73, + 0x73, 0x65, 0x78, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, + 0x22, 0x2c, 0x31, 0x30, 0x30, 0x30, 0x35, 0x2c, 0x4e, 0x6f, + 0x2c, 0x38, 0x38, 0x32, 0x2e, 0x31, 0x20, 0x2c, 0x38, 0x34, + 0x37, 0x2e, 0x37, 0x2c, 0x20, 0x39, 0x31, 0x37, 0x2e, 0x36, + 0x2c, 0x33, 0x20, 0x2c, 0x20, 0x32, 0x20, 0x2c, 0x20, 0x33, + 0x2c, 0x35, 0x31, 0x34, 0x2c, 0x66, 0x61, 0x6c, 0x6c, 0x69, + 0x6e, 0x67, 0x2c, 0x2d, 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x2d, + 0x31, 0x2e, 0x37, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x33, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, + 0x79, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, + 0x6f, 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, + 0x31, 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x32, 0x3a, 0x35, + 0x31, 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x0a, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x20, 0x6d, 0x61, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6d, + 0x6f, 0x72, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x0a, 0x0a, 0x0a, 0x54, 0x72, + 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x52, 0x69, 0x73, + 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, + 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, + 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, + 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, + 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, + 0x62, 0x6f, 0x76, 0x65, 0x20, 0x30, 0x2e, 0x0a, 0x20, 0x20, + 0x20, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x39, 0x35, 0x25, 0x20, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x20, + 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x30, + 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x69, + 0x6e, 0x67, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x39, 0x35, + 0x25, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, + 0x6c, 0x6f, 0x77, 0x20, 0x30, 0x2e, 0x0a, 0x0a, 0x22, 0x5b, + 0x72, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, + 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x64, 0x61, 0x74, 0x61, + 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, + 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x69, 0x74, 0x61, + 0x6c, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x75, 0x73, 0x65, + 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, + 0x2e, 0x20, 0x20, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x72, + 0x61, 0x74, 0x65, 0x73, 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x20, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x20, 0x49, + 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x75, + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, + 0x53, 0x74, 0x61, 0x74, 0x2e, 0x20, 0x20, 0x44, 0x65, 0x61, + 0x74, 0x68, 0x20, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61, + 0x72, 0x65, 0x20, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x64, 0x6a, + 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x20, 0x74, 0x6f, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x32, 0x30, 0x30, 0x30, 0x20, 0x55, + 0x53, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, + 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, + 0x77, 0x77, 0x77, 0x2e, 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, + 0x73, 0x74, 0x64, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x64, 0x70, 0x6f, + 0x70, 0x2e, 0x31, 0x39, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x68, + 0x74, 0x6d, 0x6c, 0x5d, 0x20, 0x28, 0x31, 0x39, 0x20, 0x61, + 0x67, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, + 0x20, 0x3c, 0x31, 0x2c, 0x20, 0x31, 0x2d, 0x34, 0x2c, 0x20, + 0x35, 0x2d, 0x39, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x2c, + 0x20, 0x38, 0x30, 0x2d, 0x38, 0x34, 0x2c, 0x20, 0x38, 0x35, + 0x2b, 0x29, 0x2e, 0x54, 0x68, 0x65, 0x20, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, + 0x65, 0x20, 0x32, 0x30, 0x33, 0x30, 0x20, 0x67, 0x6f, 0x61, + 0x6c, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, + 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x74, 0x65, + 0x73, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, + 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x69, 0x66, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, + 0x64, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, + 0x61, 0x6c, 0x2e, 0x20, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, + 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, + 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x20, 0x70, + 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x4e, 0x43, 0x49, 0x2e, + 0x20, 0x22, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x20, + 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, 0x46, 0x69, 0x6c, 0x65, + 0x20, 0x5b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x73, 0x65, 0x65, 0x72, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x70, 0x6f, 0x70, 0x64, + 0x61, 0x74, 0x61, 0x2f, 0x5d, 0x20, 0x69, 0x73, 0x20, 0x75, + 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6d, + 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x20, 0x0a, 0x22, 0x5b, 0x74, 0x72, + 0x65, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, 0x54, + 0x68, 0x65, 0x20, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x20, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x20, 0x28, 0x41, 0x41, 0x50, 0x43, 0x29, 0x20, + 0x69, 0x73, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, + 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, + 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x6f, 0x69, 0x6e, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, + 0x74, 0x6f, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x2c, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, + 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x61, 0x6c, + 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6a, 0x6f, 0x69, 0x6e, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x64, 0x69, 0x66, + 0x66, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x22, 0x0a, 0x22, 0x5b, + 0x72, 0x61, 0x6e, 0x6b, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x5d, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x49, 0x2a, + 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x20, 0x68, 0x65, 0x6c, 0x70, + 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x6e, 0x65, 0x73, 0x73, + 0x20, 0x6f, 0x66, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x2e, + 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2c, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x6c, 0x79, 0x20, 0x72, 0x61, 0x72, 0x65, 0x20, + 0x64, 0x69, 0x73, 0x65, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6f, + 0x72, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x70, 0x6f, 0x70, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, + 0x61, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, + 0x65, 0x73, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, + 0x79, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x73, 0x73, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, + 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, + 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x76, 0x61, 0x72, + 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, + 0x62, 0x75, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x64, 0x69, 0x73, 0x65, + 0x61, 0x73, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, + 0x6e, 0x73, 0x65, 0x6c, 0x79, 0x20, 0x70, 0x6f, 0x70, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, + 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, + 0x75, 0x6c, 0x2e, 0x20, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x69, + 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x20, 0x63, + 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, + 0x49, 0x2a, 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x65, 0x62, + 0x73, 0x69, 0x74, 0x65, 0x2e, 0x22, 0x0a, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x79, 0x20, 0x50, 0x65, 0x6f, 0x70, 0x6c, + 0x65, 0x20, 0x32, 0x30, 0x33, 0x30, 0x20, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x5b, 0x20, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, + 0x77, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x70, + 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2f, + 0x20, 0x5d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, + 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x65, + 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x44, 0x69, 0x73, 0x65, 0x61, 0x73, 0x65, 0x20, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x5b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, + 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x64, 0x63, 0x2e, 0x67, + 0x6f, 0x76, 0x20, 0x5d, 0x2e, 0x20, 0x0a, 0x0a, 0x0a, 0x22, + 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x6e, 0x6f, 0x74, + 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x65, + 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x66, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x2e, 0x20, 0x44, 0x75, 0x65, 0x20, + 0x74, 0x6f, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x74, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x20, 0x28, + 0x20, 0x2f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, + 0x61, 0x6c, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x2f, 0x64, 0x69, + 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, + 0x68, 0x74, 0x6d, 0x6c, 0x20, 0x29, 0x20, 0x6f, 0x66, 0x20, + 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x6d, + 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x72, + 0x65, 0x20, 0x41, 0x41, 0x50, 0x43, 0x73, 0x20, 0x62, 0x61, + 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x50, 0x43, + 0x73, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x6f, 0x6d, 0x65, + 0x20, 0x61, 0x72, 0x65, 0x20, 0x41, 0x50, 0x43, 0x73, 0x20, + 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, + 0x20, 0x69, 0x6e, 0x20, 0x53, 0x45, 0x45, 0x52, 0x2a, 0x53, + 0x74, 0x61, 0x74, 0x2e, 0x20, 0x28, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x65, 0x65, 0x72, 0x2e, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, + 0x2f, 0x73, 0x65, 0x65, 0x72, 0x73, 0x74, 0x61, 0x74, 0x2f, + 0x20, 0x29, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, + 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, + 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x20, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, + 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, + 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, + 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, 0x2e, 0x0a + )), request = structure(list( + url = "https://statecancerprofiles.cancer.gov/deathrates/index.php?stateFIPS=10&areatype=county&cancer=001&race=00&age=157&year=0&type=death&sortVariableName=rate&sortOrder=default&output=1&sex=0", + method = NULL, headers = list(), body = NULL, fields = list(), + options = list(), policies = list() + ), class = "httr2_request"), + cache = new.env() + ), class = "httr2_response") } diff --git a/R/test-dput-resp-risk.R b/R/test-dput-resp-risk.R index 4101dcf..708c688 100644 --- a/R/test-dput-resp-risk.R +++ b/R/test-dput-resp-risk.R @@ -1,155 +1,163 @@ #' Test dput-resp-demo -#' +#' #' This function creates a response object from the Demographics section of State Cancer Profiles for #' -#' +#' #' @returns A httr2 response object -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' dput_resp_risk() #' } dput_resp_risk <- function() { - resp <- structure(list(method = "GET", url = "https://statecancerprofiles.cancer.gov/risk/index.php?topic=colorec&risk=v304&type=risk&sortVariableName=percent&sortOrder=default&output=1&race=00&stateFIPS=44", - status_code = 200L, headers = structure(list(date = "Tue, 20 Feb 2024 20:40:10 GMT", - server = "Apache", `content-disposition` = "attachment; filename=\"screening_risk.csv\"", - `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", - `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", - `set-cookie` = "TKTID=web-dmzst-03; path=/; HttpOnly; Secure", - `cache-control` = "private"), class = "httr2_headers"), - body = as.raw(c(0x0d, 0x0a, 0x09, 0x53, 0x63, 0x72, 0x65, - 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, - 0x52, 0x69, 0x73, 0x6b, 0x20, 0x46, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x73, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x52, 0x68, 0x6f, 0x64, 0x65, 0x20, - 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x0a, 0x28, 0x32, 0x30, - 0x31, 0x37, 0x2d, 0x32, 0x30, 0x31, 0x39, 0x20, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x79, 0x20, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x64, 0x20, 0x45, - 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x73, 0x20, 0x43, - 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x42, - 0x52, 0x46, 0x53, 0x53, 0x20, 0x26, 0x20, 0x4e, 0x48, 0x49, - 0x53, 0x29, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x72, 0x20, 0x68, - 0x61, 0x64, 0x20, 0x46, 0x4f, 0x42, 0x54, 0x28, 0x36, 0x29, - 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, 0x52, 0x61, 0x63, 0x65, - 0x73, 0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x73, 0x20, 0x48, 0x69, 0x73, 0x70, 0x61, 0x6e, 0x69, 0x63, - 0x29, 0x2c, 0x20, 0x42, 0x6f, 0x74, 0x68, 0x20, 0x53, 0x65, - 0x78, 0x65, 0x73, 0x2c, 0x20, 0x41, 0x67, 0x65, 0x73, 0x20, - 0x35, 0x30, 0x2d, 0x37, 0x35, 0x22, 0x0a, 0x0a, 0x53, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x50, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x0a, 0x0a, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, - 0x22, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2d, 0x42, 0x61, 0x73, - 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x28, 0x33, 0x29, 0x22, 0x2c, 0x22, 0x4c, 0x6f, 0x77, 0x65, - 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x55, 0x70, - 0x70, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x0a, 0x22, - 0x42, 0x72, 0x69, 0x73, 0x74, 0x6f, 0x6c, 0x20, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, - 0x31, 0x2c, 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x30, 0x2e, 0x30, - 0x2c, 0x20, 0x35, 0x2e, 0x31, 0x0a, 0x22, 0x4e, 0x65, 0x77, - 0x70, 0x6f, 0x72, 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x35, 0x2c, 0x32, - 0x2e, 0x31, 0x20, 0x2c, 0x30, 0x2e, 0x36, 0x2c, 0x20, 0x34, - 0x2e, 0x33, 0x0a, 0x22, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x74, 0x6f, 0x6e, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x39, 0x2c, 0x34, - 0x2e, 0x32, 0x20, 0x2c, 0x31, 0x2e, 0x35, 0x2c, 0x20, 0x39, - 0x2e, 0x30, 0x0a, 0x22, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x37, 0x2c, 0x34, - 0x2e, 0x39, 0x20, 0x2c, 0x32, 0x2e, 0x31, 0x2c, 0x20, 0x31, - 0x30, 0x2e, 0x30, 0x0a, 0x22, 0x4b, 0x65, 0x6e, 0x74, 0x20, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x34, 0x34, - 0x30, 0x30, 0x33, 0x2c, 0x37, 0x2e, 0x36, 0x20, 0x2c, 0x32, - 0x2e, 0x34, 0x2c, 0x20, 0x31, 0x37, 0x2e, 0x31, 0x0a, 0x0a, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, - 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, - 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, - 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, - 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, 0x30, - 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x33, 0x3a, 0x34, 0x30, - 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x22, 0x28, 0x33, 0x29, 0x20, - 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x73, 0x20, - 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, - 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, - 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x69, 0x6e, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x42, - 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x61, 0x6c, 0x20, - 0x52, 0x69, 0x73, 0x6b, 0x20, 0x46, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x69, 0x6c, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x20, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x69, 0x65, 0x77, 0x20, 0x53, 0x75, 0x72, 0x76, - 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x72, 0x72, - 0x65, 0x63, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, - 0x6e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x62, 0x69, - 0x61, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x65, - 0x20, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x20, - 0x69, 0x6e, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x61, - 0x72, 0x65, 0x61, 0x73, 0x20, 0x62, 0x79, 0x20, 0x62, 0x6f, - 0x72, 0x72, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, - 0x61, 0x72, 0x20, 0x61, 0x72, 0x65, 0x61, 0x73, 0x20, 0x61, - 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x46, 0x6f, - 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, - 0x76, 0x69, 0x73, 0x69, 0x74, 0x20, 0x73, 0x61, 0x65, 0x2e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x22, 0x0a, 0x22, 0x28, 0x36, 0x29, 0x20, 0x46, 0x6f, - 0x72, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x2d, 0x62, 0x61, 0x73, - 0x65, 0x64, 0x20, 0x46, 0x4f, 0x42, 0x54, 0x2c, 0x20, 0x61, - 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x61, 0x67, - 0x65, 0x64, 0x20, 0x35, 0x30, 0x2d, 0x37, 0x35, 0x20, 0x6d, - 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x68, 0x61, - 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x74, 0x20, 0x6c, 0x65, - 0x61, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x46, 0x4f, - 0x42, 0x54, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, - 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, - 0x20, 0x6b, 0x69, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x68, 0x69, - 0x73, 0x2f, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x66, 0x65, - 0x2c, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, - 0x67, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x77, 0x68, - 0x6f, 0x20, 0x68, 0x61, 0x64, 0x20, 0x61, 0x20, 0x63, 0x6f, - 0x6c, 0x6f, 0x6e, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x79, 0x20, - 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x70, 0x61, 0x73, 0x74, 0x20, 0x31, 0x30, 0x20, 0x79, - 0x65, 0x61, 0x72, 0x73, 0x2e, 0x20, 0x46, 0x75, 0x72, 0x74, - 0x68, 0x65, 0x72, 0x6d, 0x6f, 0x72, 0x65, 0x2c, 0x20, 0x68, - 0x65, 0x2f, 0x73, 0x68, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, - 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x68, 0x61, - 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x73, 0x74, - 0x20, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, - 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x70, 0x61, 0x73, 0x74, 0x20, 0x79, 0x65, - 0x61, 0x72, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x74, 0x69, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x2e, 0x22, 0x0a, - 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, - 0x63, 0x6f, 0x2e, 0x0a)), request = structure(list(url = "https://statecancerprofiles.cancer.gov/risk/index.php?topic=colorec&risk=v304&type=risk&sortVariableName=percent&sortOrder=default&output=1&race=00&stateFIPS=44", - method = NULL, headers = list(), body = NULL, fields = list(), - options = list(), policies = list()), class = "httr2_request"), - cache = new.env()), class = "httr2_response") -} \ No newline at end of file + resp <- structure(list( + method = "GET", url = "https://statecancerprofiles.cancer.gov/risk/index.php?topic=colorec&risk=v304&type=risk&sortVariableName=percent&sortOrder=default&output=1&race=00&stateFIPS=44", + status_code = 200L, headers = structure(list( + date = "Tue, 20 Feb 2024 20:40:10 GMT", + server = "Apache", `content-disposition` = "attachment; filename=\"screening_risk.csv\"", + `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", + `content-type` = "text/csv; charset=iso-8859-1", `strict-transport-security` = "max-age=31536000;preload", + `set-cookie` = "TKTID=web-dmzst-03; path=/; HttpOnly; Secure", + `cache-control` = "private" + ), class = "httr2_headers"), + body = as.raw(c( + 0x0d, 0x0a, 0x09, 0x53, 0x63, 0x72, 0x65, + 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x52, 0x69, 0x73, 0x6b, 0x20, 0x46, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x73, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x52, 0x68, 0x6f, 0x64, 0x65, 0x20, + 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x79, 0x20, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x0a, 0x28, 0x32, 0x30, + 0x31, 0x37, 0x2d, 0x32, 0x30, 0x31, 0x39, 0x20, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x79, 0x20, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x64, 0x20, 0x45, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x73, 0x20, 0x43, + 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x42, + 0x52, 0x46, 0x53, 0x53, 0x20, 0x26, 0x20, 0x4e, 0x48, 0x49, + 0x53, 0x29, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x72, 0x20, 0x68, + 0x61, 0x64, 0x20, 0x46, 0x4f, 0x42, 0x54, 0x28, 0x36, 0x29, + 0x0a, 0x22, 0x41, 0x6c, 0x6c, 0x20, 0x52, 0x61, 0x63, 0x65, + 0x73, 0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x73, 0x20, 0x48, 0x69, 0x73, 0x70, 0x61, 0x6e, 0x69, 0x63, + 0x29, 0x2c, 0x20, 0x42, 0x6f, 0x74, 0x68, 0x20, 0x53, 0x65, + 0x78, 0x65, 0x73, 0x2c, 0x20, 0x41, 0x67, 0x65, 0x73, 0x20, + 0x35, 0x30, 0x2d, 0x37, 0x35, 0x22, 0x0a, 0x0a, 0x53, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x0a, 0x0a, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, + 0x22, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2d, 0x42, 0x61, 0x73, + 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x28, 0x33, 0x29, 0x22, 0x2c, 0x22, 0x4c, 0x6f, 0x77, 0x65, + 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x2c, 0x22, 0x55, 0x70, + 0x70, 0x65, 0x72, 0x20, 0x39, 0x35, 0x25, 0x20, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x0a, 0x22, + 0x42, 0x72, 0x69, 0x73, 0x74, 0x6f, 0x6c, 0x20, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, + 0x31, 0x2c, 0x31, 0x2e, 0x35, 0x20, 0x2c, 0x30, 0x2e, 0x30, + 0x2c, 0x20, 0x35, 0x2e, 0x31, 0x0a, 0x22, 0x4e, 0x65, 0x77, + 0x70, 0x6f, 0x72, 0x74, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x35, 0x2c, 0x32, + 0x2e, 0x31, 0x20, 0x2c, 0x30, 0x2e, 0x36, 0x2c, 0x20, 0x34, + 0x2e, 0x33, 0x0a, 0x22, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x74, 0x6f, 0x6e, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x39, 0x2c, 0x34, + 0x2e, 0x32, 0x20, 0x2c, 0x31, 0x2e, 0x35, 0x2c, 0x20, 0x39, + 0x2e, 0x30, 0x0a, 0x22, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x79, 0x22, 0x2c, 0x34, 0x34, 0x30, 0x30, 0x37, 0x2c, 0x34, + 0x2e, 0x39, 0x20, 0x2c, 0x32, 0x2e, 0x31, 0x2c, 0x20, 0x31, + 0x30, 0x2e, 0x30, 0x0a, 0x22, 0x4b, 0x65, 0x6e, 0x74, 0x20, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0x2c, 0x34, 0x34, + 0x30, 0x30, 0x33, 0x2c, 0x37, 0x2e, 0x36, 0x20, 0x2c, 0x32, + 0x2e, 0x34, 0x2c, 0x20, 0x31, 0x37, 0x2e, 0x31, 0x0a, 0x0a, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, + 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, + 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, 0x2f, 0x32, 0x30, + 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x33, 0x3a, 0x34, 0x30, + 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x22, 0x28, 0x33, 0x29, 0x20, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x73, 0x20, + 0x61, 0x72, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, + 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, + 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x69, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x42, + 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x61, 0x6c, 0x20, + 0x52, 0x69, 0x73, 0x6b, 0x20, 0x46, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x69, 0x6c, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x48, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x20, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x76, 0x69, 0x65, 0x77, 0x20, 0x53, 0x75, 0x72, 0x76, + 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x72, 0x72, + 0x65, 0x63, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, + 0x6e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x20, 0x62, 0x69, + 0x61, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x65, + 0x20, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x20, + 0x69, 0x6e, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x61, + 0x72, 0x65, 0x61, 0x73, 0x20, 0x62, 0x79, 0x20, 0x62, 0x6f, + 0x72, 0x72, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, + 0x61, 0x72, 0x20, 0x61, 0x72, 0x65, 0x61, 0x73, 0x20, 0x61, + 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x46, 0x6f, + 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, + 0x76, 0x69, 0x73, 0x69, 0x74, 0x20, 0x73, 0x61, 0x65, 0x2e, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x22, 0x0a, 0x22, 0x28, 0x36, 0x29, 0x20, 0x46, 0x6f, + 0x72, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x2d, 0x62, 0x61, 0x73, + 0x65, 0x64, 0x20, 0x46, 0x4f, 0x42, 0x54, 0x2c, 0x20, 0x61, + 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x61, 0x67, + 0x65, 0x64, 0x20, 0x35, 0x30, 0x2d, 0x37, 0x35, 0x20, 0x6d, + 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x68, 0x61, + 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x74, 0x20, 0x6c, 0x65, + 0x61, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x46, 0x4f, + 0x42, 0x54, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, + 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x6b, 0x69, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x68, 0x69, + 0x73, 0x2f, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x66, 0x65, + 0x2c, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, + 0x67, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x77, 0x68, + 0x6f, 0x20, 0x68, 0x61, 0x64, 0x20, 0x61, 0x20, 0x63, 0x6f, + 0x6c, 0x6f, 0x6e, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x79, 0x20, + 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x70, 0x61, 0x73, 0x74, 0x20, 0x31, 0x30, 0x20, 0x79, + 0x65, 0x61, 0x72, 0x73, 0x2e, 0x20, 0x46, 0x75, 0x72, 0x74, + 0x68, 0x65, 0x72, 0x6d, 0x6f, 0x72, 0x65, 0x2c, 0x20, 0x68, + 0x65, 0x2f, 0x73, 0x68, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, + 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x68, 0x61, + 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, + 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x70, 0x61, 0x73, 0x74, 0x20, 0x79, 0x65, + 0x61, 0x72, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x74, 0x69, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x2e, 0x22, 0x0a, + 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, + 0x63, 0x6f, 0x2e, 0x0a + )), request = structure(list( + url = "https://statecancerprofiles.cancer.gov/risk/index.php?topic=colorec&risk=v304&type=risk&sortVariableName=percent&sortOrder=default&output=1&race=00&stateFIPS=44", + method = NULL, headers = list(), body = NULL, fields = list(), + options = list(), policies = list() + ), class = "httr2_request"), + cache = new.env() + ), class = "httr2_response") +} diff --git a/R/test-dput-resp_demo.R b/R/test-dput-resp_demo.R index 556887c..deb2961 100644 --- a/R/test-dput-resp_demo.R +++ b/R/test-dput-resp_demo.R @@ -1,107 +1,114 @@ #' Test dput-resp-demo -#' +#' #' This function creates a response object from the Demographics section of State Cancer Profiles for #' -#' +#' #' @returns A httr2 response object -#' +#' #' @noRd -#' -#' @examples +#' +#' @examples #' \dontrun{ #' dput_resp_demo() #' } dput_resp_demo <- function() { - resp <- structure(list(method = "GET", url = "https://statecancerprofiles.cancer.gov/demographics/index.php?stateFIPS=72&areatype=county&topic=crowd&demo=00027&race=00&type=manyareacensus&sortVariableName=value&sortOrder=default&output=1", - status_code = 200L, headers = structure(list(date = "Thu, 15 Feb 2024 19:23:41 GMT", - server = "Apache", `content-disposition` = "attachment; filename=\"census.csv\"", - `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", - `content-type` = "text/csv;charset=UTF-8", `strict-transport-security` = "max-age=31536000;preload", - `set-cookie` = "TKTID=web-dmzst-02; path=/; HttpOnly; Secure", - `cache-control` = "private"), class = "httr2_headers"), - body = as.raw(c(0x44, 0x65, 0x6d, 0x6f, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, - 0x63, 0x6f, 0x0a, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, - 0x67, 0x3a, 0x20, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x68, 0x6f, - 0x6c, 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x3e, - 0x31, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x70, - 0x65, 0x72, 0x20, 0x72, 0x6f, 0x6f, 0x6d, 0x0a, 0x22, 0x41, - 0x6c, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x41, - 0x6c, 0x6c, 0x20, 0x52, 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, - 0x69, 0x73, 0x70, 0x61, 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, - 0x42, 0x6f, 0x74, 0x68, 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, - 0x22, 0x0a, 0x32, 0x30, 0x31, 0x37, 0x2d, 0x32, 0x30, 0x32, - 0x31, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, - 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, - 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x20, 0x35, 0x2d, - 0x59, 0x65, 0x61, 0x72, 0x20, 0x44, 0x61, 0x74, 0x61, 0x0a, - 0x53, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x28, 0x50, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x29, 0x2c, 0x48, 0x6f, 0x75, 0x73, - 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x20, 0x28, 0x77, 0x69, - 0x74, 0x68, 0x20, 0x3e, 0x31, 0x20, 0x50, 0x65, 0x72, 0x73, - 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x20, 0x52, 0x6f, 0x6f, - 0x6d, 0x29, 0x2c, 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x69, - 0x74, 0x68, 0x69, 0x6e, 0x20, 0x55, 0x53, 0x0a, 0x22, 0x55, - 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x73, 0x22, 0x2c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, - 0x33, 0x2e, 0x33, 0x2c, 0x34, 0x31, 0x33, 0x34, 0x39, 0x32, - 0x38, 0x2c, 0x22, 0x4e, 0x2f, 0x41, 0x22, 0x0a, 0x22, 0x50, - 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, - 0x22, 0x2c, 0x37, 0x32, 0x30, 0x30, 0x31, 0x2c, 0x32, 0x2e, - 0x35, 0x2c, 0x32, 0x39, 0x35, 0x38, 0x37, 0x2c, 0x22, 0x39, - 0x38, 0x38, 0x20, 0x6f, 0x66, 0x20, 0x33, 0x31, 0x34, 0x33, - 0x22, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, - 0x2e, 0x67, 0x6f, 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, - 0x2f, 0x31, 0x35, 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x32, - 0x3a, 0x32, 0x33, 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x44, 0x65, 0x6d, 0x6f, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x20, 0x64, 0x61, - 0x74, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x20, 0x42, 0x75, 0x72, 0x65, - 0x61, 0x75, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x29, 0x20, 0x26, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, - 0x61, 0x6e, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, - 0x74, 0x79, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x20, - 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2f, 0x61, 0x63, 0x73, 0x2f, 0x77, 0x77, 0x77, - 0x2f, 0x29, 0x2e, 0x0a, 0x22, 0x46, 0x6f, 0x72, 0x20, 0x6d, - 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, - 0x74, 0x20, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, 0x67, - 0x3a, 0x20, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x68, 0x6f, 0x6c, - 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x3e, 0x31, - 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x70, 0x65, - 0x72, 0x20, 0x72, 0x6f, 0x6f, 0x6d, 0x2c, 0x20, 0x73, 0x65, - 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20, - 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x70, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x64, 0x69, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, - 0x68, 0x70, 0x23, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, - 0x67, 0x2e, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, - 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, - 0x20, 0x52, 0x69, 0x63, 0x6f, 0x2e, 0x0a)), request = structure(list( - url = "https://statecancerprofiles.cancer.gov/demographics/index.php?stateFIPS=72&areatype=county&topic=crowd&demo=00027&race=00&type=manyareacensus&sortVariableName=value&sortOrder=default&output=1", - method = NULL, headers = list(), body = NULL, fields = list(), - options = list(), policies = list()), class = "httr2_request"), - cache = new.env()), class = "httr2_response") + resp <- structure(list( + method = "GET", url = "https://statecancerprofiles.cancer.gov/demographics/index.php?stateFIPS=72&areatype=county&topic=crowd&demo=00027&race=00&type=manyareacensus&sortVariableName=value&sortOrder=default&output=1", + status_code = 200L, headers = structure(list( + date = "Thu, 15 Feb 2024 19:23:41 GMT", + server = "Apache", `content-disposition` = "attachment; filename=\"census.csv\"", + `x-frame-options` = "SAMEORIGIN", `cache-control` = "public, max-age=300", + `content-type` = "text/csv;charset=UTF-8", `strict-transport-security` = "max-age=31536000;preload", + `set-cookie` = "TKTID=web-dmzst-02; path=/; HttpOnly; Secure", + `cache-control` = "private" + ), class = "httr2_headers"), + body = as.raw(c( + 0x44, 0x65, 0x6d, 0x6f, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x69, 0x63, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, + 0x63, 0x6f, 0x0a, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, + 0x67, 0x3a, 0x20, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x68, 0x6f, + 0x6c, 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x3e, + 0x31, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x70, + 0x65, 0x72, 0x20, 0x72, 0x6f, 0x6f, 0x6d, 0x0a, 0x22, 0x41, + 0x6c, 0x6c, 0x20, 0x41, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x41, + 0x6c, 0x6c, 0x20, 0x52, 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x48, + 0x69, 0x73, 0x70, 0x61, 0x6e, 0x69, 0x63, 0x29, 0x2c, 0x20, + 0x42, 0x6f, 0x74, 0x68, 0x20, 0x53, 0x65, 0x78, 0x65, 0x73, + 0x22, 0x0a, 0x32, 0x30, 0x31, 0x37, 0x2d, 0x32, 0x30, 0x32, + 0x31, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, + 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, + 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x20, 0x35, 0x2d, + 0x59, 0x65, 0x61, 0x72, 0x20, 0x44, 0x61, 0x74, 0x61, 0x0a, + 0x53, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x0a, 0x0a, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x79, 0x2c, 0x20, 0x46, 0x49, 0x50, 0x53, 0x2c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x28, 0x50, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x29, 0x2c, 0x48, 0x6f, 0x75, 0x73, + 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x20, 0x28, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x3e, 0x31, 0x20, 0x50, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x20, 0x52, 0x6f, 0x6f, + 0x6d, 0x29, 0x2c, 0x52, 0x61, 0x6e, 0x6b, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x69, 0x6e, 0x20, 0x55, 0x53, 0x0a, 0x22, 0x55, + 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x73, 0x22, 0x2c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, + 0x33, 0x2e, 0x33, 0x2c, 0x34, 0x31, 0x33, 0x34, 0x39, 0x32, + 0x38, 0x2c, 0x22, 0x4e, 0x2f, 0x41, 0x22, 0x0a, 0x22, 0x50, + 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, + 0x22, 0x2c, 0x37, 0x32, 0x30, 0x30, 0x31, 0x2c, 0x32, 0x2e, + 0x35, 0x2c, 0x32, 0x39, 0x35, 0x38, 0x37, 0x2c, 0x22, 0x39, + 0x38, 0x38, 0x20, 0x6f, 0x66, 0x20, 0x33, 0x31, 0x34, 0x33, + 0x22, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x20, 0x62, 0x79, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, + 0x2e, 0x67, 0x6f, 0x76, 0x20, 0x6f, 0x6e, 0x20, 0x30, 0x32, + 0x2f, 0x31, 0x35, 0x2f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x32, + 0x3a, 0x32, 0x33, 0x20, 0x70, 0x6d, 0x2e, 0x0a, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20, 0x44, 0x65, 0x6d, 0x6f, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x20, 0x64, 0x61, + 0x74, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x20, 0x42, 0x75, 0x72, 0x65, + 0x61, 0x75, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, + 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x29, 0x20, 0x26, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, + 0x61, 0x6e, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, + 0x74, 0x79, 0x20, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x20, + 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, + 0x77, 0x2e, 0x63, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2f, 0x61, 0x63, 0x73, 0x2f, 0x77, 0x77, 0x77, + 0x2f, 0x29, 0x2e, 0x0a, 0x22, 0x46, 0x6f, 0x72, 0x20, 0x6d, + 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, + 0x74, 0x20, 0x43, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, 0x67, + 0x3a, 0x20, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x3e, 0x31, + 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x70, 0x65, + 0x72, 0x20, 0x72, 0x6f, 0x6f, 0x6d, 0x2c, 0x20, 0x73, 0x65, + 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20, + 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x76, 0x2f, 0x64, 0x69, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, + 0x68, 0x70, 0x23, 0x63, 0x72, 0x6f, 0x77, 0x64, 0x69, 0x6e, + 0x67, 0x2e, 0x22, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, + 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x20, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, + 0x20, 0x52, 0x69, 0x63, 0x6f, 0x2e, 0x0a + )), request = structure(list( + url = "https://statecancerprofiles.cancer.gov/demographics/index.php?stateFIPS=72&areatype=county&topic=crowd&demo=00027&race=00&type=manyareacensus&sortVariableName=value&sortOrder=default&output=1", + method = NULL, headers = list(), body = NULL, fields = list(), + options = list(), policies = list() + ), class = "httr2_request"), + cache = new.env() + ), class = "httr2_response") return(resp) } diff --git a/man/demo_crowding.Rd b/man/demo_crowding.Rd index 4cba156..60d92e5 100644 --- a/man/demo_crowding.Rd +++ b/man/demo_crowding.Rd @@ -45,20 +45,26 @@ Cancer Profiles. } \examples{ \dontrun{ -demo_crowding(area = "WA", - areatype = "hsa", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") - -demo_crowding(area = "usa", - areatype = "state", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") +demo_crowding( + area = "WA", + areatype = "hsa", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" +) + +demo_crowding( + area = "usa", + areatype = "state", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" +) -demo_crowding(area = "pr", - areatype = "hsa", - crowding = "household with >1 person per room", - race = "black") +demo_crowding( + area = "pr", + areatype = "hsa", + crowding = "household with >1 person per room", + race = "black" +) } } diff --git a/man/demo_education.Rd b/man/demo_education.Rd index d290ee7..a7ecc0d 100644 --- a/man/demo_education.Rd +++ b/man/demo_education.Rd @@ -42,26 +42,34 @@ demo_education(area, areatype, education, sex = NULL, race = NULL) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, Households, Rank. } \description{ -This function returns a data frame about education demographics from State Cancer Profiles. +This function returns a data frame about education demographics from +State Cancer Profiles. } \examples{ \dontrun{ -demo_education(area = "wa", - areatype = "county", - education = "at least high school", - sex = "males") - -demo_education(area = "usa", - areatype = "state", - education = "at least bachelors degree", - sex = "both sexes", - race = "all races (includes hispanic)") - -demo_education(area = "pr", - areatype = "hsa", - education = "less than 9th grade") +demo_education( + area = "wa", + areatype = "county", + education = "at least high school", + sex = "males" +) + +demo_education( + area = "usa", + areatype = "state", + education = "at least bachelors degree", + sex = "both sexes", + race = "all races (includes hispanic)" +) + +demo_education( + area = "pr", + areatype = "hsa", + education = "less than 9th grade" +) } } diff --git a/man/demo_food.Rd b/man/demo_food.Rd index 4fdc53c..fa05d17 100644 --- a/man/demo_food.Rd +++ b/man/demo_food.Rd @@ -26,25 +26,33 @@ demo_food(area, areatype, food, race = NULL) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Value, People". +A data frame with the following columns: +Area Type, Area Code, Value, People. } \description{ -This function returns a data frame about food demographics from State Cancer Profiles. +This function returns a data frame about food demographics from +State Cancer Profiles. } \examples{ \dontrun{ -demo_food(area = "wa", - areatype = "county", - food = "food insecurity", - race = "black") - -demo_food(area = "usa", - areatype = "state", - food = "limited access to healthy food") - -demo_food(area = "pr", - areatype = "county", - food = "food insecurity", - race = "all races (includes hispanic)") +demo_food( + area = "wa", + areatype = "county", + food = "food insecurity", + race = "black" +) + +demo_food( + area = "usa", + areatype = "state", + food = "limited access to healthy food" +) + +demo_food( + area = "pr", + areatype = "county", + food = "food insecurity", + race = "all races (includes hispanic)" +) } } diff --git a/man/demo_income.Rd b/man/demo_income.Rd index 75ecaa6..ac650b2 100644 --- a/man/demo_income.Rd +++ b/man/demo_income.Rd @@ -25,26 +25,34 @@ demo_income(area, areatype, income, race) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Dollars, Rank. +A data frame with the following columns: +Area Type, Area Code, Dollars, Rank. } \description{ -This function returns a data frame about income demographics from State Cancer Profiles. +This function returns a data frame about income demographics from +State Cancer Profiles. } \examples{ \dontrun{ -demo_income(area = "wa", - areatype = "county", - income = "median household income", - race = "all races (includes hispanic)") - -demo_income(area = "usa", - areatype = "state", - income = "median family income", - race = "all races (includes hispanic)") - -demo_income(area = "pr", - areatype = "county", - income = "median family income", - race = "all races (includes hispanic)") +demo_income( + area = "wa", + areatype = "county", + income = "median household income", + race = "all races (includes hispanic)" +) + +demo_income( + area = "usa", + areatype = "state", + income = "median family income", + race = "all races (includes hispanic)" +) + +demo_income( + area = "pr", + areatype = "county", + income = "median family income", + race = "all races (includes hispanic)" +) } } diff --git a/man/demo_insurance.Rd b/man/demo_insurance.Rd index 2ef8181..f04addf 100644 --- a/man/demo_insurance.Rd +++ b/man/demo_insurance.Rd @@ -75,23 +75,29 @@ This function returns a data frame about insurance demographics from State Cance } \examples{ \dontrun{ -demo_insurance(area = "usa", - areatype = "state", - insurance = "\% Insured in demographic group, all income levels", - sex = "both sexes", - age = "18 to 64 years", - race = "white (non-hispanic)") - -demo_insurance(area = "wa", - areatype = "hsa", - insurance = "\% Insured in demographic group, all income levels", - sex = "males", - age = "18 to 64 years") - -demo_insurance(area = "dc", - areatype = "county", - insurance = "\% Insured in demographic group, all income levels", - sex = "males", - age = "18 to 64 years") +demo_insurance( + area = "usa", + areatype = "state", + insurance = "\% Insured in demographic group, all income levels", + sex = "both sexes", + age = "18 to 64 years", + race = "white (non-hispanic)" +) + +demo_insurance( + area = "wa", + areatype = "hsa", + insurance = "\% Insured in demographic group, all income levels", + sex = "males", + age = "18 to 64 years" +) + +demo_insurance( + area = "dc", + areatype = "county", + insurance = "\% Insured in demographic group, all income levels", + sex = "males", + age = "18 to 64 years" +) } } diff --git a/man/demo_language.Rd b/man/demo_language.Rd index c8623f8..28cbd8c 100644 --- a/man/demo_language.Rd +++ b/man/demo_language.Rd @@ -20,21 +20,29 @@ demo_language(area, areatype, language) \code{"language isolation"}.} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, Households, Rank. } \description{ -This function returns a data frame about language demographics from State Cancer Profiles. +This function returns a data frame about language demographics +from State Cancer Profiles. } \examples{ -demo_language(area = "WA", - areatype = "county", - language = "language isolation") - -demo_language(area = "dc", - areatype = "hsa", - language = "language isolation") - -demo_language(area = "usa", - areatype = "state", - language = "language isolation") +demo_language( + area = "WA", + areatype = "county", + language = "language isolation" +) + +demo_language( + area = "dc", + areatype = "hsa", + language = "language isolation" +) + +demo_language( + area = "usa", + areatype = "state", + language = "language isolation" +) } diff --git a/man/demo_mobility.Rd b/man/demo_mobility.Rd index 121e70c..84c5fc6 100644 --- a/man/demo_mobility.Rd +++ b/man/demo_mobility.Rd @@ -26,23 +26,31 @@ demo_mobility(area, areatype, mobility) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, People, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, People, Rank. } \description{ -This function returns a data frame about mobility demographics from State Cancer Profiles. +This function returns a data frame about mobility demographics +from State Cancer Profiles. } \examples{ \dontrun{ -demo_mobility(area = "WA", - areatype = "county", - mobility = "moved, different county, same state (in past year)") - -demo_mobility(area = "usa", - areatype = "state", - mobility = "moved, same county (in past year)") - -demo_mobility(area = "dc", - areatype = "hsa", - mobility = "moved, same county (in past year)") +demo_mobility( + area = "WA", + areatype = "county", + mobility = "moved, different county, same state (in past year)" +) + +demo_mobility( + area = "usa", + areatype = "state", + mobility = "moved, same county (in past year)" +) + +demo_mobility( + area = "dc", + areatype = "hsa", + mobility = "moved, same county (in past year)" +) } } diff --git a/man/demo_population.Rd b/man/demo_population.Rd index ffd7864..d98ab78 100644 --- a/man/demo_population.Rd +++ b/man/demo_population.Rd @@ -54,29 +54,36 @@ demo_population(area, areatype, population, race = NULL, sex = NULL) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, Households, Rank. } \description{ -This function returns a data frame from population in State Cancer Profiles. +This function returns a data frame about population +from State Cancer Profiles. } \examples{ \dontrun{ -demo_population(area = "WA", - areatype = "county", - population = "males", - race = "all races (includes hispanic)") - -demo_population(area = "dc", - areatype = "hsa", - population = "foreign born", - race = "black", - sex = "females") - -demo_population(area = "usa", - areatype = "state", - population = "foreign born", - race = "hispanic (any race)", - sex = "females") +demo_population( + area = "WA", + areatype = "county", + population = "males", + race = "all races (includes hispanic)" +) +demo_population( + area = "dc", + areatype = "hsa", + population = "foreign born", + race = "black", + sex = "females" +) + +demo_population( + area = "usa", + areatype = "state", + population = "foreign born", + race = "hispanic (any race)", + sex = "females" +) } } diff --git a/man/demo_poverty.Rd b/man/demo_poverty.Rd index 73d581e..020e2e9 100644 --- a/man/demo_poverty.Rd +++ b/man/demo_poverty.Rd @@ -43,25 +43,33 @@ demo_poverty(area, areatype, poverty, race = NULL, sex = NULL) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, Households, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, Households, Rank. } \description{ -This function returns a data frame about poverty demographics from State Cancer Profiles. +This function returns a data frame about poverty demographics +from State Cancer Profiles. } \examples{ \dontrun{ -demo_poverty(area = "WA", - areatype = "county", - poverty = "persistent poverty") - -demo_poverty(area = "usa", - areatype = "state", - poverty = "families below poverty", - race = "black") - -demo_poverty(area = "dc", - areatype = "hsa", - poverty = "families below poverty", - race = "All Races (includes Hispanic)") +demo_poverty( + area = "WA", + areatype = "county", + poverty = "persistent poverty" +) + +demo_poverty( + area = "usa", + areatype = "state", + poverty = "families below poverty", + race = "black" +) + +demo_poverty( + area = "dc", + areatype = "hsa", + poverty = "families below poverty", + race = "All Races (includes Hispanic)" +) } } diff --git a/man/demo_svi.Rd b/man/demo_svi.Rd index 7aacd1a..a79ec3c 100644 --- a/man/demo_svi.Rd +++ b/man/demo_svi.Rd @@ -19,20 +19,27 @@ demo_svi(area, svi) }} } \value{ -A data frame with the following columns County, FIPS, Score. +A data frame with the following columns: County, FIPS, Score. } \description{ -This function returns a data frame from social vulnerability index (SVI) in State Cancer Profiles. +This function returns a data frame about social vulnerability index (SVI) +from State Cancer Profiles. } \examples{ \dontrun{ -demo_svi(area = "WA", - svi = "overall") - -demo_svi(area = "usa", - svi = "overall") - -demo_svi(area = "dc", - svi = "socioeconomic status") +demo_svi( + area = "WA", + svi = "overall" +) + +demo_svi( + area = "usa", + svi = "overall" +) + +demo_svi( + area = "dc", + svi = "socioeconomic status" +) } } diff --git a/man/demo_workforce.Rd b/man/demo_workforce.Rd index 85e4d71..e794e0f 100644 --- a/man/demo_workforce.Rd +++ b/man/demo_workforce.Rd @@ -38,29 +38,36 @@ demo_workforce(area, areatype, workforce, race, sex) }} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, People Unemployed, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, People Unemployed, Rank. } \description{ This function returns a data frame from Workforce in State Cancer Profiles. } \examples{ \dontrun{ -demo_workforce(area = "WA", - areatype = "county", - workforce = "unemployed", - race = "all races (includes hispanic)", - sex = "both sexes") - -demo_workforce(area = "usa", - areatype = "state", - workforce = "unemployed", - race = "all races (includes hispanic)", - sex = "females") - -demo_workforce(area = "pr", - areatype = "hsa", - workforce = "unemployed", - race = "all races (includes hispanic)", - sex = "both sexes") +demo_workforce( + area = "WA", + areatype = "county", + workforce = "unemployed", + race = "all races (includes hispanic)", + sex = "both sexes" +) + +demo_workforce( + area = "usa", + areatype = "state", + workforce = "unemployed", + race = "all races (includes hispanic)", + sex = "females" +) + +demo_workforce( + area = "pr", + areatype = "hsa", + workforce = "unemployed", + race = "all races (includes hispanic)", + sex = "both sexes" +) } } diff --git a/man/risk_colorectal_screening.Rd b/man/risk_colorectal_screening.Rd index fe9d894..2dc111d 100644 --- a/man/risk_colorectal_screening.Rd +++ b/man/risk_colorectal_screening.Rd @@ -36,10 +36,12 @@ risk_colorectal_screening(screening, race = NULL, sex = NULL, area = NULL) \item{area}{A state/territory abbreviation or USA.} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, People Unemployed, Rank. +A data frame with the following columns: +Area Type, Area Code, Percent, People Unemployed, Rank. } \description{ -This function returns a data frame about colorectal screening from State Cancer Profiles. +This function returns a data frame about +colorectal screening from State Cancer Profiles. } \examples{ \dontrun{ diff --git a/man/risk_smoking.Rd b/man/risk_smoking.Rd index 0fa4d4b..dfeea37 100644 --- a/man/risk_smoking.Rd +++ b/man/risk_smoking.Rd @@ -54,13 +54,17 @@ risk_smoking(smoking, race = NULL, sex = NULL, datatype = NULL, area = NULL) \item{area}{A state/territory abbreviation or USA.} } \value{ -A data frame with the following columns: Area Type, Area Code, Percent, Lower CI 95\%, Upper CI 95\%, Number of Respondents. +A data frame with the following columns: +Area Type, Area Code, Percent, Lower CI 95\%, Upper CI 95\%, +Number of Respondents. } \description{ -This function returns a data frame about smoking risks from State Cancer Profiles. +This function returns a data frame about smoking risks +from State Cancer Profiles. } \details{ -Please note that this function requires very specific arguments for each smoking type. +Please note that this function requires +very specific arguments for each smoking type. } \examples{ \dontrun{ diff --git a/tests/testthat/test-demo-crowding.R b/tests/testthat/test-demo-crowding.R index 7c9f191..179b2bd 100644 --- a/tests/testthat/test-demo-crowding.R +++ b/tests/testthat/test-demo-crowding.R @@ -1,40 +1,47 @@ #' Test demo-crowding -#' +#' #' This testthat file test the demo-crowding function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- demo_crowding(area = "wa", - areatype = "hsa", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") - + output <- demo_crowding( + area = "wa", + areatype = "hsa", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-crowding returns non-empty data frame", { skip_on_cran() - crowding1 <- demo_crowding(area = "wa", - areatype = "hsa", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") + crowding1 <- demo_crowding( + area = "wa", + areatype = "hsa", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" + ) expect_true(is.data.frame(crowding1)) }) -#demo-crowding must have 5 columns +# demo-crowding must have 5 columns test_that("demo-crowding has correct number of columns", { skip_on_cran() - df <- demo_crowding(area = "wa", - areatype = "hsa", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") + df <- demo_crowding( + area = "wa", + areatype = "hsa", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" + ) expected_columns <- 5 + expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-crowding has correct parameters", { expect_error(demo_crowding()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-education.R b/tests/testthat/test-demo-education.R index dcdb2a3..85094d4 100644 --- a/tests/testthat/test-demo-education.R +++ b/tests/testthat/test-demo-education.R @@ -1,30 +1,32 @@ #' Test demo-education -#' +#' #' This testthat file test the demo-education function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_education("wa", "county", "at least high school", "males") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-education returns non-empty data frame", { skip_on_cran() education1 <- demo_education("wa", "county", "at least high school", "males") expect_true(is.data.frame(education1)) - + education2 <- demo_education("ca", "hsa", "less than 9th grade") expect_true(is.data.frame(education2)) - - education3 <- demo_education("usa", "state", "at least bachelors degree", - "both sexes", "all races (includes hispanic)") + + education3 <- demo_education( + "usa", "state", "at least bachelors degree", + "both sexes", "all races (includes hispanic)" + ) expect_true(is.data.frame(education3)) }) -#demo-education must have 5 columns +# demo-education must have 5 columns test_that("demo-education has correct number of columns", { skip_on_cran() df <- demo_education("wa", "county", "at least high school", "both sexes") @@ -32,9 +34,7 @@ test_that("demo-education has correct number of columns", { expect_equal(ncol(df), expected_columns) }) -#test error handling - -#write one for error handling in education - mention in the message how values could have chnaged in SCP +# test error handling test_that("demo-education handles invalid education parameters", { skip_on_cran() expect_error( @@ -42,7 +42,13 @@ test_that("demo-education handles invalid education parameters", { "For Less than 9th Grade, Race and Sex must be NULL" ) expect_error( - demo_education("wa", "county", "at least high school", "all races (includes hispanic", "females"), + demo_education( + "wa", + "county", + "at least high school", + "all races (includes hispanic", + "females" + ), "For At Least High School, Race must be NULL and Sex must be NOT NULL" ) expect_error( @@ -51,7 +57,7 @@ test_that("demo-education handles invalid education parameters", { ) }) -#parameter +# parameter test_that("demo-education has correct parameters", { expect_error(demo_education()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-food-access.R b/tests/testthat/test-demo-food-access.R index 972b90b..2f7fb93 100644 --- a/tests/testthat/test-demo-food-access.R +++ b/tests/testthat/test-demo-food-access.R @@ -1,30 +1,32 @@ #' Test Food Access -#' +#' #' This testthat file test the demo-food function -#tests class and typeof output +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_food("wa", "county", "food insecurity", "black") - + expect_equal(class(output), "data.frame", - info = "Output should be a data frame") - + info = "Output should be a data frame" + ) + expect_equal(typeof(output), "list", - info = "Output should have list storage type (since data frames are lists)") + info = "Output should have list storage type (since data frames are lists)" + ) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-food returns non-empty data frame", { skip_on_cran() food_test_1 <- demo_food("wa", "county", "food insecurity", "all races (includes hispanic)") expect_true(!is.null(food_test_1)) expect_true(is.data.frame(food_test_1)) - + food_test_2 <- demo_food("usa", "state", "limited access to healthy food") expect_true(!is.null(food_test_2)) expect_true(is.data.frame(food_test_2)) - + food_test_3 <- demo_food("pr", "county", "food insecurity", "all races (includes hispanic)") expect_true(!is.null(food_test_3)) expect_true(is.data.frame(food_test_3)) @@ -42,7 +44,7 @@ test_that("demo-food has correct number of columns", { expect_equal(ncol(df2), expected_columns2) }) -#test error handling +# test error handling test_that("demo-food handles invalid education parameters", { skip_on_cran() expect_error( @@ -55,7 +57,7 @@ test_that("demo-food handles invalid education parameters", { ) }) -#parameter +# parameter test_that("demo-food has correct parameters", { expect_error(demo_food()) }) diff --git a/tests/testthat/test-demo-income.R b/tests/testthat/test-demo-income.R index 5b744a3..091d829 100644 --- a/tests/testthat/test-demo-income.R +++ b/tests/testthat/test-demo-income.R @@ -1,26 +1,26 @@ #' Test demo-income -#' +#' #' This testthat file test the demo-income function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_income("wa", "county", "median family income", "all races (includes hispanic)") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-income returns non-empty data frame", { skip_on_cran() income1 <- demo_income("wa", "county", "median family income", "all races (includes hispanic)") expect_true(is.data.frame(income1)) - + income2 <- demo_income("usa", "state", "median household income", "all races (includes hispanic)") expect_true(is.data.frame(income2)) }) -#demo-income must have 5 columns +# demo-income must have 5 columns test_that("demo-income has correct number of columns", { skip_on_cran() df <- demo_income("usa", "state", "median household income", "all races (includes hispanic)") @@ -28,7 +28,7 @@ test_that("demo-income has correct number of columns", { expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-income has correct parameters", { expect_error(demo_income()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-insurance.R b/tests/testthat/test-demo-insurance.R index fe0c579..2853b90 100644 --- a/tests/testthat/test-demo-insurance.R +++ b/tests/testthat/test-demo-insurance.R @@ -1,61 +1,73 @@ #' Test demo-insurance -#' +#' #' This testthat file test the demo-insurance function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- demo_insurance("usa", "state", "% Insured in demographic group, all income levels", - "both sexes", "under 19 years", "all races (includes hispanic)") - + output <- demo_insurance( + "usa", "state", "% Insured in demographic group, all income levels", + "both sexes", "under 19 years", "all races (includes hispanic)" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -insurance_options <- c("% Insured in demographic group, all income levels", - "% Insured in demographic group, people at or below 138% of Poverty", - "% Insured in demographic group, people at or below 200% of Poverty", - "% Insured in demographic group, people at or below 250% of Poverty", - "% Insured in demographic group, people at or below 400% of Poverty", - "% Insured in demographic group, people between 138% - 400% of poverty", - "% uninsured in demographic group, all income levels", - "% uninsured in demographic group, people at or below 138% of Poverty", - "% uninsured in demographic group, people at or below 200% of Poverty", - "% uninsured in demographic group, people at or below 250% of Poverty", - "% uninsured in demographic group, people at or below 400% of Poverty", - "% uninsured in demographic group, people between 138% - 400% of poverty") +# Ensures that variables are present and working on SCP +insurance_options <- c( + "% Insured in demographic group, all income levels", + "% Insured in demographic group, people at or below 138% of Poverty", + "% Insured in demographic group, people at or below 200% of Poverty", + "% Insured in demographic group, people at or below 250% of Poverty", + "% Insured in demographic group, people at or below 400% of Poverty", + "% Insured in demographic group, people between 138% - 400% of poverty", + "% uninsured in demographic group, all income levels", + "% uninsured in demographic group, people at or below 138% of Poverty", + "% uninsured in demographic group, people at or below 200% of Poverty", + "% uninsured in demographic group, people at or below 250% of Poverty", + "% uninsured in demographic group, people at or below 400% of Poverty", + "% uninsured in demographic group, people between 138% - 400% of poverty" +) for (option in insurance_options) { test_that("demo-insurance returns non-empty data frame", { skip_on_cran() - expect_true(is.data.frame(demo_insurance("usa", "state", option, "both sexes", - "under 19 years", "all races (includes hispanic)"))) + expect_true(is.data.frame(demo_insurance( + "usa", "state", option, "both sexes", + "under 19 years", "all races (includes hispanic)" + ))) }) } -#demo-insurance must have 5 columns +# demo-insurance must have 5 columns test_that("demo-insurance has correct number of columns", { skip_on_cran() - df <- demo_insurance("wa", "hsa", "% Insured in demographic group, all income levels", - "males", "18 to 64 years") + df <- demo_insurance( + "wa", "hsa", "% Insured in demographic group, all income levels", + "males", "18 to 64 years" + ) expected_columns <- 5 expect_equal(ncol(df), expected_columns) }) -#test error handling +# test error handling test_that("demo-insurance handles invalid insurance parameters", { skip_on_cran() expect_error( - demo_insurance("wa", "county", "% Insured in demographic group, all income levels", - "males", "18 to 64 years", "all races (includes hispanic)") + demo_insurance( + "wa", "county", "% Insured in demographic group, all income levels", + "males", "18 to 64 years", "all races (includes hispanic)" + ) ) expect_error( - demo_insurance("usa", "state", "% Insured in demographic group, all income levels", - "males", "18 to 64 years") + demo_insurance( + "usa", "state", "% Insured in demographic group, all income levels", + "males", "18 to 64 years" + ) ) }) -#parameter +# parameter test_that("demo-insurance has correct parameters", { expect_error(demo_insurance()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-mobility.R b/tests/testthat/test-demo-mobility.R index 2884c25..f29880d 100644 --- a/tests/testthat/test-demo-mobility.R +++ b/tests/testthat/test-demo-mobility.R @@ -1,20 +1,22 @@ #' Test demo-mobility -#' +#' #' This testthat file test the demo-mobility function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_mobility("wa", "county", "moved, different county, same state (in past year)") - + expect_true(inherits(output, "data.frame")) }) -mobility_options <- c("i haven't moved (in past year)", - "moved from outside us (in past year)", - "moved, different state (in past year)", - "moved, different county, same state (in past year)", - "moved, same county (in past year)") +mobility_options <- c( + "i haven't moved (in past year)", + "moved from outside us (in past year)", + "moved, different state (in past year)", + "moved, different county, same state (in past year)", + "moved, same county (in past year)" +) for (option in mobility_options) { @@ -24,7 +26,7 @@ for (option in mobility_options) { }) } -#demo-mobility must have 5 columns +# demo-mobility must have 5 columns test_that("demo-mobility has correct number of columns", { skip_on_cran() df <- demo_mobility("wa", "county", "moved, different county, same state (in past year)") @@ -32,7 +34,7 @@ test_that("demo-mobility has correct number of columns", { expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-mobility has correct parameters", { expect_error(demo_mobility()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-non-english-language.R b/tests/testthat/test-demo-non-english-language.R index f6b5b94..9a7dc76 100644 --- a/tests/testthat/test-demo-non-english-language.R +++ b/tests/testthat/test-demo-non-english-language.R @@ -1,23 +1,23 @@ #' Test demo-language -#' +#' #' This testthat file test the demo-language function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_language("wa", "county", "language isolation") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-language returns non-empty data frame", { skip_on_cran() language1 <- demo_language("wa", "county", "language isolation") expect_true(is.data.frame(language1)) }) -#demo-language must have 5 columns +# demo-language must have 5 columns test_that("demo-language has correct number of columns", { skip_on_cran() df <- demo_language("wa", "county", "language isolation") @@ -25,7 +25,7 @@ test_that("demo-language has correct number of columns", { expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-language has correct parameters", { expect_error(demo_language()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-population.R b/tests/testthat/test-demo-population.R index f49dd4c..6ee966b 100644 --- a/tests/testthat/test-demo-population.R +++ b/tests/testthat/test-demo-population.R @@ -1,16 +1,16 @@ #' Test demo-population -#' +#' #' This testthat file test the demo-population function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- demo_population("WA", "county", "asian/pacific islander", sex="females") - + output <- demo_population("WA", "county", "asian/pacific islander", sex = "females") + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP population_options <- list( age1 = demo_population("wa", "county", "age under 18", "all races (includes hispanic)", "both sexes"), age2 = demo_population("wa", "county", "ages 60 and over", "all races (includes hispanic)", "both sexes"), @@ -31,29 +31,31 @@ for (option_name in names(population_options)) { }) } -race_options <- c("american indian/alaska native", "asian/pacific islander", - "black", "hispanic", "non-hispanic (origin recode)") +race_options <- c( + "american indian/alaska native", "asian/pacific islander", + "black", "hispanic", "non-hispanic (origin recode)" +) for (option in race_options) { test_that("demo-population returns non-empty data frame", { skip_on_cran() - expect_true(is.data.frame(demo_population("wa", "county", option, sex="both sexes"))) + expect_true(is.data.frame(demo_population("wa", "county", option, sex = "both sexes"))) }) } -#demo-population must have 5 columns +# demo-population must have 5 columns test_that("demo-population has correct number of columns", { skip_on_cran() - df <- demo_population("WA", "county", "asian/pacific islander", sex="females") + df <- demo_population("WA", "county", "asian/pacific islander", sex = "females") expected_columns <- 5 expect_equal(ncol(df), expected_columns) }) -#test error handling +# test error handling test_that("demo-population handles invalid population parameters", { skip_on_cran() expect_error( - demo_population("wa", "county", "ages 40 and over", race="all races includes hispanic"), + demo_population("wa", "county", "ages 40 and over", race = "all races includes hispanic"), "ages 40 and over and ages 50 and over, Race and Sex must be NULL" ) expect_error( @@ -66,7 +68,7 @@ test_that("demo-population handles invalid population parameters", { ) }) -#parameter +# parameter test_that("demo-population has correct parameters", { expect_error(demo_population()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-poverty.R b/tests/testthat/test-demo-poverty.R index f623a92..91d84c8 100644 --- a/tests/testthat/test-demo-poverty.R +++ b/tests/testthat/test-demo-poverty.R @@ -1,16 +1,16 @@ #' Test demo-poverty -#' +#' #' This testthat file test the demo-poverty function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_poverty("wa", "county", "persistent poverty") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP poverty_options <- list( pov1 = demo_poverty("wa", "county", "persistent poverty"), pov2 = demo_poverty("wa", "county", "families below poverty", "black"), @@ -26,7 +26,7 @@ for (option_name in names(poverty_options)) { }) } -#demo-poverty must have 5 columns +# demo-poverty must have 5 columns test_that("demo-poverty has correct number of columns", { skip_on_cran() df1 <- demo_poverty("wa", "county", "persistent poverty") @@ -37,7 +37,7 @@ test_that("demo-poverty has correct number of columns", { expect_equal(ncol(df2), expected_columns2) }) -#test error handling +# test error handling test_that("demo-poverty handles invalid poverty parameters", { skip_on_cran() expect_error( @@ -54,7 +54,7 @@ test_that("demo-poverty handles invalid poverty parameters", { ) }) -#parameter +# parameter test_that("demo-poverty has correct parameters", { expect_error(demo_poverty()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-svi.R b/tests/testthat/test-demo-svi.R index 9904ad1..0a4be22 100644 --- a/tests/testthat/test-demo-svi.R +++ b/tests/testthat/test-demo-svi.R @@ -1,18 +1,19 @@ #' Test demo-svi -#' +#' #' This testthat file test the demo-svi function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- demo_svi("wa", "overall") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -svi_options <- c("Overall", "socioeconomic status", "household characteristics", - "racial & ethinic minority status", "housing type & transportation" +# Ensures that variables are present and working on SCP +svi_options <- c( + "Overall", "socioeconomic status", "household characteristics", + "racial & ethinic minority status", "housing type & transportation" ) for (option in svi_options) { @@ -22,7 +23,7 @@ for (option in svi_options) { }) } -#demo-svi must have 5 columns +# demo-svi must have 5 columns test_that("demo-svi has correct number of columns", { skip_on_cran() df <- demo_svi("wa", "overall") @@ -30,7 +31,7 @@ test_that("demo-svi has correct number of columns", { expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-svi has correct parameters", { expect_error(demo_svi()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-demo-workforce.R b/tests/testthat/test-demo-workforce.R index 5d94a31..6bcfbc3 100644 --- a/tests/testthat/test-demo-workforce.R +++ b/tests/testthat/test-demo-workforce.R @@ -1,34 +1,40 @@ #' Test demo-workforce -#' +#' #' This testthat file test the demo-workforce function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- demo_workforce("wa", "county", "unemployed", - "all races (includes hispanic)", "both sexes") - + output <- demo_workforce( + "wa", "county", "unemployed", + "all races (includes hispanic)", "both sexes" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("demo-workforce returns non-empty data frame", { skip_on_cran() - workforce1 <- demo_workforce("wa", "county", "unemployed", - "all races (includes hispanic)", "both sexes") + workforce1 <- demo_workforce( + "wa", "county", "unemployed", + "all races (includes hispanic)", "both sexes" + ) expect_true(is.data.frame(workforce1)) }) -#demo-workforce must have 5 columns +# demo-workforce must have 5 columns test_that("demo-workforce has correct number of columns", { skip_on_cran() - df <- demo_workforce("wa", "county", "unemployed", - "all races (includes hispanic)", "both sexes") + df <- demo_workforce( + "wa", "county", "unemployed", + "all races (includes hispanic)", "both sexes" + ) expected_columns <- 5 expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("demo-workforce has correct parameters", { expect_error(demo_workforce()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-age.R b/tests/testthat/test-handle-age.R index a761010..8655174 100644 --- a/tests/testthat/test-handle-age.R +++ b/tests/testthat/test-handle-age.R @@ -1,13 +1,13 @@ #' Test Handle age -#' +#' #' This testthat file tests the handle-age function test_that("handle age correctly maps age", { result <- sapply(c("under 19 years", "under 65 years", "all ages"), handle_age) expected <- c(`under 19 years` = "175", `under 65 years` = "006", `all ages` = "001") - + expect_equal(result, expected) }) test_that("handle age expects errors for incorrect arguments", { expect_error(handle_age("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-alcohol.R b/tests/testthat/test-handle-alcohol.R index e4fd64d..77729ca 100644 --- a/tests/testthat/test-handle-alcohol.R +++ b/tests/testthat/test-handle-alcohol.R @@ -1,13 +1,13 @@ #' Test Handle alcohol -#' +#' #' This testthat file tests the handle-age function test_that("handle_alcohol correctly maps alcohol", { result <- sapply(c("binge drinking (4+ drinks on one occasion for women, 5+ drinks for one occasion for men), ages 21+"), handle_alcohol) expected <- c(`binge drinking (4+ drinks on one occasion for women, 5+ drinks for one occasion for men), ages 21+` = "v505") - + expect_equal(result, expected) }) test_that("handle_alcohol expects errors for incorrect arguments", { expect_error(handle_alcohol("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-cancer.R b/tests/testthat/test-handle-cancer.R index 04702e2..c6c9adf 100644 --- a/tests/testthat/test-handle-cancer.R +++ b/tests/testthat/test-handle-cancer.R @@ -1,13 +1,13 @@ #' Test Handle cancer -#' +#' #' This testthat file tests the handle-cancer function test_that("handle cancer correctly maps cancer", { result <- sapply(c("all cancer sites", "breast (female)", "prostate"), handle_cancer) expected <- c(`all cancer sites` = "001", `breast (female)` = "055", `prostate` = "066") - + expect_equal(result, expected) }) test_that("handle cancer expects errors for incorrect arguments", { expect_error(handle_cancer("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-crowding.R b/tests/testthat/test-handle-crowding.R index 3c9b313..c93a8fd 100644 --- a/tests/testthat/test-handle-crowding.R +++ b/tests/testthat/test-handle-crowding.R @@ -1,13 +1,13 @@ #' Test Handle crowding -#' +#' #' This testthat file tests the handle-crowding function test_that("handle crowding correctly maps crowding", { result <- sapply(c("household with >1 person per room"), handle_crowding) expected <- c(`household with >1 person per room` = "00027") - + expect_equal(result, expected) }) test_that("handle crowding expects errors for incorrect arguments", { expect_error(handle_crowding("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-diet-exercise.R b/tests/testthat/test-handle-diet-exercise.R index 7c00544..e08065d 100644 --- a/tests/testthat/test-handle-diet-exercise.R +++ b/tests/testthat/test-handle-diet-exercise.R @@ -1,15 +1,19 @@ #' Test Handle diet_exercise -#' +#' #' This testthat file tests the handle-diet_exercise function test_that("handle diet_exercise correctly maps diet_exercise", { - result <- sapply(c("bmi is healthy, ages 20+", "bmi is obese, ages 20+", - "consumed 1 or more fruits per day"), handle_diet_exercise) - expected <- c(`bmi is healthy, ages 20+` = "v01", `bmi is obese, ages 20+` = "v02", - `consumed 1 or more fruits per day` = "v50") - + result <- sapply(c( + "bmi is healthy, ages 20+", "bmi is obese, ages 20+", + "consumed 1 or more fruits per day" + ), handle_diet_exercise) + expected <- c( + `bmi is healthy, ages 20+` = "v01", `bmi is obese, ages 20+` = "v02", + `consumed 1 or more fruits per day` = "v50" + ) + expect_equal(result, expected) }) test_that("handle diet_exercise expects errors for incorrect arguments", { expect_error(handle_diet_exercise("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-education.R b/tests/testthat/test-handle-education.R index b78dea6..b5c2598 100644 --- a/tests/testthat/test-handle-education.R +++ b/tests/testthat/test-handle-education.R @@ -1,15 +1,19 @@ #' Test Handle education -#' +#' #' This testthat file tests the handle-education function test_that("handle education correctly maps education", { - result <- sapply(c("less than 9th grade", "at least high school", - "at least bachelors degree"), handle_education) - expected <- c(`less than 9th grade` = "00004", `at least high school` = "00109", - `at least bachelors degree` = "00006") - + result <- sapply(c( + "less than 9th grade", "at least high school", + "at least bachelors degree" + ), handle_education) + expected <- c( + `less than 9th grade` = "00004", `at least high school` = "00109", + `at least bachelors degree` = "00006" + ) + expect_equal(result, expected) }) test_that("handle education expects errors for incorrect arguments", { expect_error(handle_education("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-food.R b/tests/testthat/test-handle-food.R index 8c1f293..8ebde82 100644 --- a/tests/testthat/test-handle-food.R +++ b/tests/testthat/test-handle-food.R @@ -1,13 +1,13 @@ #' Test Handle food -#' +#' #' This testthat file tests the handle-food function test_that("handle food correctly maps food", { result <- sapply(c("food insecurity", "limited access to healthy food"), handle_food) expected <- c(`food insecurity` = "03003", `limited access to healthy food` = "03004") - + expect_equal(result, expected) }) test_that("handle food expects errors for incorrect arguments", { expect_error(handle_food("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-income.R b/tests/testthat/test-handle-income.R index b1a673d..50cad40 100644 --- a/tests/testthat/test-handle-income.R +++ b/tests/testthat/test-handle-income.R @@ -1,13 +1,13 @@ #' Test Handle income -#' +#' #' This testthat file tests the handle-income function test_that("handle income correctly maps income", { result <- sapply(c("median family income", "median household income"), handle_income) expected <- c(`median family income` = "00010", `median household income` = "00011") - + expect_equal(result, expected) }) test_that("handle income expects errors for incorrect arguments", { expect_error(handle_income("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-insurance.R b/tests/testthat/test-handle-insurance.R index 67daf64..b53f2c9 100644 --- a/tests/testthat/test-handle-insurance.R +++ b/tests/testthat/test-handle-insurance.R @@ -1,18 +1,24 @@ #' Test Handle insurance -#' +#' #' This testthat file tests the handle-insurance function test_that("handle insurance correctly maps insurance", { - result <- sapply(c("% insured in demographic group, all income levels", - "% uninsured in demographic group, all income levels", - "% insured in demographic group, people at or below 138% of poverty"), - handle_insurance) - expected <- c(`% insured in demographic group, all income levels` = "00030", - `% uninsured in demographic group, all income levels` = "00040", - `% insured in demographic group, people at or below 138% of poverty` = "00033") - + result <- sapply( + c( + "% insured in demographic group, all income levels", + "% uninsured in demographic group, all income levels", + "% insured in demographic group, people at or below 138% of poverty" + ), + handle_insurance + ) + expected <- c( + `% insured in demographic group, all income levels` = "00030", + `% uninsured in demographic group, all income levels` = "00040", + `% insured in demographic group, people at or below 138% of poverty` = "00033" + ) + expect_equal(result, expected) }) test_that("handle insurance expects errors for incorrect arguments", { expect_error(handle_insurance("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-mobility.R b/tests/testthat/test-handle-mobility.R index 03fd9f4..bf74d51 100644 --- a/tests/testthat/test-handle-mobility.R +++ b/tests/testthat/test-handle-mobility.R @@ -1,17 +1,21 @@ #' Test Handle mobility -#' +#' #' This testthat file tests the handle-mobility function test_that("handle mobility correctly maps mobility", { - result <- sapply(c("i haven't moved (in past year)", - "moved from outside us (in past year)", - "moved, same county (in past year)"), handle_mobility) - expected <- c(`i haven't moved (in past year)` = "00017", - `moved from outside us (in past year)` = "00021", - `moved, same county (in past year)` = "00018") - + result <- sapply(c( + "i haven't moved (in past year)", + "moved from outside us (in past year)", + "moved, same county (in past year)" + ), handle_mobility) + expected <- c( + `i haven't moved (in past year)` = "00017", + `moved from outside us (in past year)` = "00021", + `moved, same county (in past year)` = "00018" + ) + expect_equal(result, expected) }) test_that("handle mobility expects errors for incorrect arguments", { expect_error(handle_mobility("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-non-english.R b/tests/testthat/test-handle-non-english.R index 4df9580..c89bc20 100644 --- a/tests/testthat/test-handle-non-english.R +++ b/tests/testthat/test-handle-non-english.R @@ -1,13 +1,13 @@ #' Test Handle Non-english -#' +#' #' This testthat file tests the handle_non_english function test_that("handle_non_english correctly maps language", { result <- sapply(c("language isolation"), handle_non_english) expected <- c(`language isolation` = "00015") - + expect_equal(result, expected) }) test_that("handle_non_english expects errors for incorrect arguments", { expect_error(handle_non_english("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-population.R b/tests/testthat/test-handle-population.R index b4f96ed..74f3c15 100644 --- a/tests/testthat/test-handle-population.R +++ b/tests/testthat/test-handle-population.R @@ -1,13 +1,13 @@ #' Test Handle population -#' +#' #' This testthat file tests the handle-population function test_that("handle population correctly maps population", { result <- sapply(c("age under 18", "foreign born", "males"), handle_population) expected <- c(`age under 18` = "00002", `foreign born` = "00014", `males` = "00104") - + expect_equal(result, expected) }) test_that("handle population expects errors for incorrect arguments", { expect_error(handle_population("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-poverty.R b/tests/testthat/test-handle-poverty.R index bb658c4..90e4351 100644 --- a/tests/testthat/test-handle-poverty.R +++ b/tests/testthat/test-handle-poverty.R @@ -1,15 +1,19 @@ #' Test Handle poverty -#' +#' #' This testthat file tests the handle-poverty function test_that("handle poverty correctly maps poverty", { - result <- sapply(c("families below poverty", "persistent poverty", - "persons below poverty"), handle_poverty) - expected <- c(`families below poverty` = "00007", `persistent poverty` = "03001", - `persons below poverty` = "00008") - + result <- sapply(c( + "families below poverty", "persistent poverty", + "persons below poverty" + ), handle_poverty) + expected <- c( + `families below poverty` = "00007", `persistent poverty` = "03001", + `persons below poverty` = "00008" + ) + expect_equal(result, expected) }) test_that("handle poverty expects errors for incorrect arguments", { expect_error(handle_poverty("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-race.R b/tests/testthat/test-handle-race.R index 403bc44..918cd63 100644 --- a/tests/testthat/test-handle-race.R +++ b/tests/testthat/test-handle-race.R @@ -1,16 +1,20 @@ #' Test Handle race -#' +#' #' This testthat file tests the handle-race function test_that("handle race correctly maps race", { - result <- sapply(c("all races (includes hispanic)", "white (non-hispanic)", - "asian (non-hispanic)"), handle_race) - expected <- c(`all races (includes hispanic)` = "00", - `white (non-hispanic)` = "07", - `asian (non-hispanic)` = "49") - + result <- sapply(c( + "all races (includes hispanic)", "white (non-hispanic)", + "asian (non-hispanic)" + ), handle_race) + expected <- c( + `all races (includes hispanic)` = "00", + `white (non-hispanic)` = "07", + `asian (non-hispanic)` = "49" + ) + expect_equal(result, expected) }) test_that("handle race expects errors for incorrect arguments", { expect_error(handle_race("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-risk-datatype.R b/tests/testthat/test-handle-risk-datatype.R index 9e4b824..87e3c39 100644 --- a/tests/testthat/test-handle-risk-datatype.R +++ b/tests/testthat/test-handle-risk-datatype.R @@ -1,13 +1,13 @@ #' Test Handle datatype -#' +#' #' This testthat file tests the handle-datatype function test_that("handle datatype correctly maps datatype", { result <- sapply(c("direct estimates", "county level modeled estimates"), handle_datatype) expected <- c(`direct estimates` = "0", `county level modeled estimates` = "1") - + expect_equal(result, expected) }) test_that("handle datatype expects errors for incorrect arguments", { expect_error(handle_datatype("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-screening.R b/tests/testthat/test-handle-screening.R index 45ec1c0..7f202cc 100644 --- a/tests/testthat/test-handle-screening.R +++ b/tests/testthat/test-handle-screening.R @@ -1,17 +1,21 @@ #' Test Handle screening -#' +#' #' This testthat file tests the handle-screening function test_that("handle screening correctly maps screening", { - result <- sapply(c("ever had fobt, ages 50-75", - "guidance sufficient crc, ages 50-75", - "home blood stool test in the past year, ages 45-75"), handle_screening) - expected <- c(`ever had fobt, ages 50-75` = "v304", - `guidance sufficient crc, ages 50-75` = "v303", - `home blood stool test in the past year, ages 45-75` = "v520") - + result <- sapply(c( + "ever had fobt, ages 50-75", + "guidance sufficient crc, ages 50-75", + "home blood stool test in the past year, ages 45-75" + ), handle_screening) + expected <- c( + `ever had fobt, ages 50-75` = "v304", + `guidance sufficient crc, ages 50-75` = "v303", + `home blood stool test in the past year, ages 45-75` = "v520" + ) + expect_equal(result, expected) }) test_that("handle screening expects errors for incorrect arguments", { expect_error(handle_screening("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-sex.R b/tests/testthat/test-handle-sex.R index e4973e0..78d2b08 100644 --- a/tests/testthat/test-handle-sex.R +++ b/tests/testthat/test-handle-sex.R @@ -1,13 +1,13 @@ #' Test Handle Sex -#' +#' #' This testthat file tests the handle-sex function test_that("handle sex correctly maps sex", { result <- sapply(c("both sexes", "males", "females"), handle_sex) expected <- c(`both sexes` = "0", males = "1", females = "2") - + expect_equal(result, expected) }) test_that("handle sex expects errors for incorrect arguments", { expect_error(handle_sex("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-smoking.R b/tests/testthat/test-handle-smoking.R index 4e46b34..17e7df3 100644 --- a/tests/testthat/test-handle-smoking.R +++ b/tests/testthat/test-handle-smoking.R @@ -1,17 +1,21 @@ #' Test Handle smoking -#' +#' #' This testthat file tests the handle-smoking function test_that("handle smoking correctly maps age", { - result <- sapply(c("smokers (current); ages 18+", - "smokers (ever); ages 18+", - "smoking laws (any)"), handle_smoking) - expected <- c(`smokers (current); ages 18+` = "v19", - `smokers (ever); ages 18+` = "v28", - `smoking laws (any)` = "v44") - + result <- sapply(c( + "smokers (current); ages 18+", + "smokers (ever); ages 18+", + "smoking laws (any)" + ), handle_smoking) + expected <- c( + `smokers (current); ages 18+` = "v19", + `smokers (ever); ages 18+` = "v28", + `smoking laws (any)` = "v44" + ) + expect_equal(result, expected) }) test_that("handle smoking expects errors for incorrect arguments", { expect_error(handle_smoking("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-stage.R b/tests/testthat/test-handle-stage.R index d4c84a9..719ae59 100644 --- a/tests/testthat/test-handle-stage.R +++ b/tests/testthat/test-handle-stage.R @@ -1,13 +1,13 @@ #' Test Handle stage -#' +#' #' This testthat file tests the handle-stage function test_that("handle stage correctly maps stage", { result <- sapply(c("all stages", "late stage (regional & distant)"), handle_stage) expected <- c(`all stages` = "999", `late stage (regional & distant)` = "211") - + expect_equal(result, expected) }) test_that("handle stage expects errors for incorrect arguments", { expect_error(handle_stage("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-svi.R b/tests/testthat/test-handle-svi.R index fd54b6e..1b15508 100644 --- a/tests/testthat/test-handle-svi.R +++ b/tests/testthat/test-handle-svi.R @@ -1,15 +1,19 @@ #' Test Handle svi -#' +#' #' This testthat file tests the handle-svi function test_that("handle svi correctly maps svi", { - result <- sapply(c("overall", "socioeconomic status", - "household characteristics"), handle_svi) - expected <- c(`overall` = "03010", `socioeconomic status` = "03011", - `household characteristics` = "03012") - + result <- sapply(c( + "overall", "socioeconomic status", + "household characteristics" + ), handle_svi) + expected <- c( + `overall` = "03010", `socioeconomic status` = "03011", + `household characteristics` = "03012" + ) + expect_equal(result, expected) }) test_that("handle svi expects errors for incorrect arguments", { expect_error(handle_svi("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-vaccine.R b/tests/testthat/test-handle-vaccine.R index f32b64b..6f729d2 100644 --- a/tests/testthat/test-handle-vaccine.R +++ b/tests/testthat/test-handle-vaccine.R @@ -1,16 +1,22 @@ #' Test Handle vaccine -#' +#' #' This testthat file tests the handle-vaccine function test_that("handle vaccine correctly maps vaccine", { - result <- sapply(c("percent with up to date hpv vaccination coverage, ages 13-15", - "percent with up to date hpv vaccination coverage, ages 13-17"), - handle_vaccine) - expected <- c(`percent with up to date hpv vaccination coverage, ages 13-15` = "v281", - `percent with up to date hpv vaccination coverage, ages 13-17` = "v282") - + result <- sapply( + c( + "percent with up to date hpv vaccination coverage, ages 13-15", + "percent with up to date hpv vaccination coverage, ages 13-17" + ), + handle_vaccine + ) + expected <- c( + `percent with up to date hpv vaccination coverage, ages 13-15` = "v281", + `percent with up to date hpv vaccination coverage, ages 13-17` = "v282" + ) + expect_equal(result, expected) }) test_that("handle vaccine expects errors for incorrect arguments", { expect_error(handle_vaccine("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-whealth.R b/tests/testthat/test-handle-whealth.R index 21dcee1..9babc96 100644 --- a/tests/testthat/test-handle-whealth.R +++ b/tests/testthat/test-handle-whealth.R @@ -1,18 +1,24 @@ #' Test Handle Women's Health -#' +#' #' This testthat file tests the handle-whealth function test_that("handle whealth correctly maps whealth", { - result <- sapply(c("mammogram in past 2 years, ages 50-74", - "mammogram in past 2 years, ages 40+", - "pap smear in past 3 years, no hysterectomy, ages 21-65"), - handle_women_health) - expected <- c(`mammogram in past 2 years, ages 50-74` = "v05", - `mammogram in past 2 years, ages 40+` = "v06", - `pap smear in past 3 years, no hysterectomy, ages 21-65` = "v17") - + result <- sapply( + c( + "mammogram in past 2 years, ages 50-74", + "mammogram in past 2 years, ages 40+", + "pap smear in past 3 years, no hysterectomy, ages 21-65" + ), + handle_women_health + ) + expected <- c( + `mammogram in past 2 years, ages 50-74` = "v05", + `mammogram in past 2 years, ages 40+` = "v06", + `pap smear in past 3 years, no hysterectomy, ages 21-65` = "v17" + ) + expect_equal(result, expected) }) test_that("handle whealth expects errors for incorrect arguments", { expect_error(handle_women_health("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-workforce.R b/tests/testthat/test-handle-workforce.R index 103ea05..8397cfa 100644 --- a/tests/testthat/test-handle-workforce.R +++ b/tests/testthat/test-handle-workforce.R @@ -1,13 +1,13 @@ #' Test Handle workforce -#' +#' #' This testthat file tests the handle-workforce function test_that("handle workforce correctly maps workforce", { result <- sapply(c("unemployed"), handle_workforce) expected <- c(`unemployed` = "00012") - + expect_equal(result, expected) }) test_that("handle workforce expects errors for incorrect arguments", { expect_error(handle_workforce("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-handle-year.R b/tests/testthat/test-handle-year.R index f1c02bc..6ec946a 100644 --- a/tests/testthat/test-handle-year.R +++ b/tests/testthat/test-handle-year.R @@ -1,13 +1,13 @@ #' Test Handle year -#' +#' #' This testthat file tests the handle-year function test_that("handle year correctly maps year", { result <- sapply(c("latest 5 year average", "latest single year (us by state)"), handle_year) expected <- c(`latest 5 year average` = "0", `latest single year (us by state)` = "1") - + expect_equal(result, expected) }) test_that("handle year expects errors for incorrect arguments", { expect_error(handle_year("carrot")) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-incidence-cancer.R b/tests/testthat/test-incidence-cancer.R index 1dc6962..f6a75b4 100644 --- a/tests/testthat/test-incidence-cancer.R +++ b/tests/testthat/test-incidence-cancer.R @@ -5,48 +5,64 @@ # tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- incidence_cancer("wa", "county", "all cancer sites", "black (non-hispanic)", - "both sexes", "ages 65+", "all stages", "latest 5 year average") - + output <- incidence_cancer( + "wa", "county", "all cancer sites", "black (non-hispanic)", + "both sexes", "ages 65+", "all stages", "latest 5 year average" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -cancer_options <- c("all cancer sites","bladder", "brain & ons", "colon & rectum", - "esophagus", "kidney & renal pelvis", "leukemia", "liver & bile duct", - "lung & bronchus", "melanoma of the skin", "non-hodgkin lymphoma", - "oral cavity & pharynx", "pancreas", "stomach", "thyroid") +# Ensures that variables are present and working on SCP +cancer_options <- c( + "all cancer sites", "bladder", "brain & ons", "colon & rectum", + "esophagus", "kidney & renal pelvis", "leukemia", "liver & bile duct", + "lung & bronchus", "melanoma of the skin", "non-hodgkin lymphoma", + "oral cavity & pharynx", "pancreas", "stomach", "thyroid" +) for (option in cancer_options) { test_that("incidence cancer returns non-empty data frame", { skip_on_cran() - result <- incidence_cancer("wa", "county", option, "all races (includes hispanic)", - "both sexes", "all ages", "all stages", "latest 5 year average") + result <- incidence_cancer( + "wa", "county", option, "all races (includes hispanic)", + "both sexes", "all ages", "all stages", "latest 5 year average" + ) expect_true(is.data.frame(result)) }) } -female_cancer_options <- c("breast (female)", "breast (female in situ)", - "cervix", "ovary", "uterus (corpus & uterus, nos)") +female_cancer_options <- c( + "breast (female)", "breast (female in situ)", + "cervix", "ovary", "uterus (corpus & uterus, nos)" +) for (option in female_cancer_options) { test_that("incidence female cancer returns non-empty data frame", { skip_on_cran() - result <- incidence_cancer("wa", "county", option, - "all races (includes hispanic)", "females", - "ages 50+", "all stages", "latest 5 year average") - + result <- incidence_cancer( + "wa", "county", option, + "all races (includes hispanic)", "females", + "ages 50+", "all stages", "latest 5 year average" + ) + expect_true(is.data.frame(result)) }) } childhood_male_cancer_options <- list( - childhood15 = incidence_cancer("ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", - "males", "ages <20", "all stages", "latest 5 year average"), - childhood20 = incidence_cancer("ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", - "males", "ages <20", "all stages", "latest 5 year average"), - prostate = incidence_cancer("usa", "state", "prostate", "all races (includes hispanic)", - "males", "ages 50+", "all stages", "latest 5 year average") + childhood15 = incidence_cancer( + "ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", + "males", "ages <20", "all stages", "latest 5 year average" + ), + childhood20 = incidence_cancer( + "ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", + "males", "ages <20", "all stages", "latest 5 year average" + ), + prostate = incidence_cancer( + "usa", "state", "prostate", "all races (includes hispanic)", + "males", "ages 50+", "all stages", "latest 5 year average" + ) ) for (option_name in names(childhood_male_cancer_options)) { @@ -57,21 +73,24 @@ for (option_name in names(childhood_male_cancer_options)) { }) } -#incidence_cancer must have 14 columns +# incidence_cancer must have 14 columns test_that("incidence_cancer has correct number of columns", { skip_on_cran() - df1 <- incidence_cancer("wa", "county", "all cancer sites", "black (non-hispanic)", - "both sexes", "ages 65+", "all stages", "latest 5 year average") - df2 <- incidence_cancer("usa", "state", "lung & bronchus", "all races (includes hispanic)", "males", - "ages 50+", "late stage (regional & distant)", "latest 5 year average") + df1 <- incidence_cancer( + "wa", "county", "all cancer sites", "black (non-hispanic)", + "both sexes", "ages 65+", "all stages", "latest 5 year average" + ) + df2 <- incidence_cancer( + "usa", "state", "lung & bronchus", "all races (includes hispanic)", "males", + "ages 50+", "late stage (regional & distant)", "latest 5 year average" + ) expected_columns1 <- 13 expected_columns2 <- 10 expect_equal(ncol(df1), expected_columns1) expect_equal(ncol(df2), expected_columns2) - }) -#parameter +# parameter test_that("incidence_cancer has correct parameters", { expect_error(incidence_cancer()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-mortality-cancer.R b/tests/testthat/test-mortality-cancer.R index b06fee7..3fb77d0 100644 --- a/tests/testthat/test-mortality-cancer.R +++ b/tests/testthat/test-mortality-cancer.R @@ -5,23 +5,29 @@ # tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- mortality_cancer("wa", "county", "all cancer sites", "black (non-hispanic)", - "both sexes", "ages 65+", "latest 5 year average") - + output <- mortality_cancer( + "wa", "county", "all cancer sites", "black (non-hispanic)", + "both sexes", "ages 65+", "latest 5 year average" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -cancer_options <- c("all cancer sites","bladder", "brain & ons", "colon & rectum", - "esophagus", "kidney & renal pelvis", "leukemia", "liver & bile duct", - "lung & bronchus", "melanoma of the skin", "non-hodgkin lymphoma", - "oral cavity & pharynx", "pancreas", "stomach", "thyroid") +# Ensures that variables are present and working on SCP +cancer_options <- c( + "all cancer sites", "bladder", "brain & ons", "colon & rectum", + "esophagus", "kidney & renal pelvis", "leukemia", "liver & bile duct", + "lung & bronchus", "melanoma of the skin", "non-hodgkin lymphoma", + "oral cavity & pharynx", "pancreas", "stomach", "thyroid" +) for (option in cancer_options) { test_that("mortality cancer returns non-empty data frame", { skip_on_cran() - result <- mortality_cancer("wa", "county", option, "all races (includes hispanic)", - "both sexes", "all ages", "latest 5 year average") + result <- mortality_cancer( + "wa", "county", option, "all races (includes hispanic)", + "both sexes", "all ages", "latest 5 year average" + ) expect_true(is.data.frame(result)) }) } @@ -32,18 +38,24 @@ for (option in female_cancer_options) { test_that("mortality female cancer returns non-empty data frame", { skip_on_cran() result <- mortality_cancer("wa", "county", option, "all races (includes hispanic)", "females", "ages 50+", "latest 5 year average") - + expect_true(is.data.frame(result)) }) } childhood_male_cancer_options <- list( - childhood15 = mortality_cancer("ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", - "males", "ages <20", "latest 5 year average"), - childhood20 = mortality_cancer("ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", - "males", "ages <20", "latest 5 year average"), - prostate = mortality_cancer("usa", "state", "prostate", "all races (includes hispanic)", - "males", "ages 50+", "latest 5 year average") + childhood15 = mortality_cancer( + "ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", + "males", "ages <20", "latest 5 year average" + ), + childhood20 = mortality_cancer( + "ca", "hsa", "childhood (ages <20, all sites)", "all races (includes hispanic)", + "males", "ages <20", "latest 5 year average" + ), + prostate = mortality_cancer( + "usa", "state", "prostate", "all races (includes hispanic)", + "males", "ages 50+", "latest 5 year average" + ) ) for (option_name in names(childhood_male_cancer_options)) { @@ -54,17 +66,18 @@ for (option_name in names(childhood_male_cancer_options)) { }) } -#mortality_cancer must have 14 columns +# mortality_cancer must have 14 columns test_that("mortality_cancer has correct number of columns", { skip_on_cran() - df <- mortality_cancer("wa", "county", "all cancer sites", "black (non-hispanic)", - "both sexes", "ages 65+", "latest 5 year average") + df <- mortality_cancer( + "wa", "county", "all cancer sites", "black (non-hispanic)", + "both sexes", "ages 65+", "latest 5 year average" + ) expected_columns <- 14 expect_equal(ncol(df), expected_columns) - }) -#parameter +# parameter test_that("mortality_cancer has correct parameters", { expect_error(mortality_cancer()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-process-incidence.R b/tests/testthat/test-process-incidence.R index 718906c..12c68c2 100644 --- a/tests/testthat/test-process-incidence.R +++ b/tests/testthat/test-process-incidence.R @@ -8,11 +8,13 @@ result <- process_incidence(resp) # process incidence should return a data frame test_that("process incidence should return a data frame", { + skip_on_cran() expect_true(is.data.frame(result)) }) # process incidence should have the correct parameter test_that("process incidence should have resp as an argument", { + skip_on_cran() expect_error( process_incidence() ) @@ -21,22 +23,24 @@ test_that("process incidence should have resp as an argument", { # process incidence data should start on the column names and end with data # containing a FIPS value test_that("process incidence outputs data from the correct line", { + skip_on_cran() area_headers <- c("County", "State", "Health.Service.Area") - + expect_true(any(colnames(result) %in% area_headers)) - + expect_true("FIPS" %in% colnames(result)) expect_true(!is.na(result[nrow(result), "FIPS"])) }) # process incidence filters out correct data test_that("process incidence filters out United States and state names", { + skip_on_cran() # Filters out "United States" from all results expect_false(any(result[1] == "United States")) - + # Filters out State names from County and HSA county_hsa <- c("County", "Health.Service.Area") if (colnames(result)[1] %in% county_hsa) { expect_false(any(result[1] == state.name)) } -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-process-mortality.R b/tests/testthat/test-process-mortality.R index dbec4cd..8593f60 100644 --- a/tests/testthat/test-process-mortality.R +++ b/tests/testthat/test-process-mortality.R @@ -8,11 +8,13 @@ result <- process_mortality(resp) # process mortality should return a data frame test_that("process mortality should return a data frame", { + skip_on_cran() expect_true(is.data.frame(result)) }) # process mortality should have the correct parameter test_that("process mortality should have resp as an argument", { + skip_on_cran() expect_error( process_mortality() ) @@ -21,22 +23,24 @@ test_that("process mortality should have resp as an argument", { # process mortality data should start on the column names and end with data # containing a FIPS value test_that("process mortality outputs data from the correct line", { + skip_on_cran() area_headers <- c("County", "State", "Health.Service.Area") - + expect_true(any(colnames(result) %in% area_headers)) - + expect_true("FIPS" %in% colnames(result)) expect_true(!is.na(result[nrow(result), "FIPS"])) }) # process mortality filters out correct data test_that("process mortality filters out United States and state names", { + skip_on_cran() # Filters out "United States" from all results expect_false(any(result[1] == "United States")) - + # Filters out State names from County and HSA county_hsa <- c("County", "Health.Service.Area") if (colnames(result)[1] %in% county_hsa) { expect_false(any(result[1] == state.name)) } -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-process-response.R b/tests/testthat/test-process-response.R index f72c136..4524cd7 100644 --- a/tests/testthat/test-process-response.R +++ b/tests/testthat/test-process-response.R @@ -8,11 +8,13 @@ result <- process_response(resp) # process response should return a data frame test_that("process_response should return a data frame", { + skip_on_cran() expect_true(is.data.frame(result)) }) # process response should have the correct parameter test_that("process response should have resp as an argument", { + skip_on_cran() expect_error( process_response() ) @@ -21,22 +23,24 @@ test_that("process response should have resp as an argument", { # process response data should start on the column names and end with data # containing a FIPS value test_that("process response outputs data from the correct line", { + skip_on_cran() area_headers <- c("County", "State", "Health.Service.Area") - + expect_true(any(colnames(result) %in% area_headers)) - + expect_true("FIPS" %in% colnames(result)) expect_true(!is.na(result[nrow(result), "FIPS"])) }) # process response filters out correct data test_that("process response filters out United States and state names", { + skip_on_cran() # Filters out "United States" from all results expect_false(any(result[1] == "United States")) - + # Filters out State names from County and HSA county_hsa <- c("County", "Health.Service.Area") if (colnames(result)[1] %in% county_hsa) { expect_false(any(result[1] == state.name)) } -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-process-screening.R b/tests/testthat/test-process-screening.R index ff99f9f..fe62f2b 100644 --- a/tests/testthat/test-process-screening.R +++ b/tests/testthat/test-process-screening.R @@ -8,11 +8,13 @@ result <- process_screening(resp) # process screening should return a data frame test_that("process_screening should return a data frame", { + skip_on_cran() expect_true(is.data.frame(result)) }) # process screening should have the correct parameter test_that("process screening should have resp as an argument", { + skip_on_cran() expect_error( process_screening() ) @@ -21,22 +23,24 @@ test_that("process screening should have resp as an argument", { # process screening data should start on the column names and end with data # containing a FIPS value test_that("process screening outputs data from the correct line", { + skip_on_cran() area_headers <- c("County", "State", "Health.Service.Area") - + expect_true(any(colnames(result) %in% area_headers)) - + expect_true("FIPS" %in% colnames(result)) expect_true(!is.na(result[nrow(result), "FIPS"])) }) # process screening filters out correct data test_that("process screening filters out United States and state names", { + skip_on_cran() # Filters out "United States" from all results expect_false(any(result[1] == "United States")) - + # Filters out State names from County and HSA county_hsa <- c("County", "Health.Service.Area") if (colnames(result)[1] %in% county_hsa) { expect_false(any(result[1] == state.name)) } -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-alcohol.R b/tests/testthat/test-risk-alcohol.R index 5136610..5a3059c 100644 --- a/tests/testthat/test-risk-alcohol.R +++ b/tests/testthat/test-risk-alcohol.R @@ -1,37 +1,49 @@ #' Test risk-alcohol -#' +#' #' This testthat file test the risk-alcohol function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- risk_alcohol(paste("binge drinking (4+ drinks on one occasion for women,", - "5+ drinks for one occasion for men), ages 21+"), - "all races (includes hispanic)", "both sexes") - + output <- risk_alcohol( + paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + ), + "all races (includes hispanic)", "both sexes" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP test_that("risk-alcohol returns non-empty data frame", { skip_on_cran() - alcohol1 <- risk_alcohol(paste("binge drinking (4+ drinks on one occasion for women,", - "5+ drinks for one occasion for men), ages 21+"), - "all races (includes hispanic)", "both sexes") + alcohol1 <- risk_alcohol( + paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + ), + "all races (includes hispanic)", "both sexes" + ) expect_true(is.data.frame(alcohol1)) }) -#risk-alcohol must have 5 columns +# risk-alcohol must have 5 columns test_that("risk-alcohol has correct number of columns", { skip_on_cran() - df <- risk_alcohol(paste("binge drinking (4+ drinks on one occasion for women,", - "5+ drinks for one occasion for men), ages 21+"), - "all races (includes hispanic)", "both sexes") + df <- risk_alcohol( + paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + ), + "all races (includes hispanic)", "both sexes" + ) expected_columns <- 6 expect_equal(ncol(df), expected_columns) }) -#parameter +# parameter test_that("risk-alcohol has correct parameters", { expect_error(demo_alcohol()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-colorectal-screening.R b/tests/testthat/test-risk-colorectal-screening.R index 3021d2a..894a925 100644 --- a/tests/testthat/test-risk-colorectal-screening.R +++ b/tests/testthat/test-risk-colorectal-screening.R @@ -1,24 +1,28 @@ #' Test risk-colorectal-screening -#' +#' #' This testthat file test the risk-colorectal-screening function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- risk_colorectal_screening("ever had fobt, ages 50-75", area="wa") - + output <- risk_colorectal_screening("ever had fobt, ages 50-75", area = "wa") + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP screening_options <- list( screening1 = risk_colorectal_screening("ever had fobt, ages 50-75", area = "wa"), screening2 = risk_colorectal_screening("guidance sufficient crc, ages 50-75", area = "wa"), screening3 = risk_colorectal_screening("had colonoscopy in past 10 years, ages 50-75", area = "wa"), - screening4 = risk_colorectal_screening("home blood stool test in the past year, ages 45-75", - "all races (includes hispanic)", "both sexes"), - screening5 = risk_colorectal_screening("received at least one recommended crc test, ages 45-75", - "all races (includes hispanic)", "both sexes") + screening4 = risk_colorectal_screening( + "home blood stool test in the past year, ages 45-75", + "all races (includes hispanic)", "both sexes" + ), + screening5 = risk_colorectal_screening( + "received at least one recommended crc test, ages 45-75", + "all races (includes hispanic)", "both sexes" + ) ) for (option_name in names(screening_options)) { @@ -29,33 +33,37 @@ for (option_name in names(screening_options)) { }) } -#risk-colorectal-screening must have 5 columns +# risk-colorectal-screening must have 5 columns test_that("risk-colorectal-screening has correct number of columns", { skip_on_cran() - df1 <- risk_colorectal_screening("ever had fobt, ages 50-75", area="wa") - df2 <- risk_colorectal_screening("home blood stool test in the past year, ages 45-75", - "all races (includes hispanic)","both sexes") + df1 <- risk_colorectal_screening("ever had fobt, ages 50-75", area = "wa") + df2 <- risk_colorectal_screening( + "home blood stool test in the past year, ages 45-75", + "all races (includes hispanic)", "both sexes" + ) expected_columns1 <- 5 expected_columns2 <- 6 expect_equal(ncol(df1), expected_columns1) expect_equal(ncol(df2), expected_columns2) }) -#test error handling +# test error handling test_that("risk-colorectal-screening handles invalid colorectal_screening parameters", { skip_on_cran() expect_error( - risk_colorectal_screening("ever had fobt, ages 50-75", race="all races (includes hispanic)"), + risk_colorectal_screening("ever had fobt, ages 50-75", race = "all races (includes hispanic)"), "for this screening type, area must NOT be NULL and Race and Sex must be NULL" ) expect_error( - risk_colorectal_screening("home blood stool test in the past year, ages 45-75", - "all races (includes hispanic)"), + risk_colorectal_screening( + "home blood stool test in the past year, ages 45-75", + "all races (includes hispanic)" + ), "For this screening type, Race and Sex must not be NULL" ) }) -#parameter +# parameter test_that("risk-colorectal-screening has correct parameters", { expect_error(risk_colorectal_screening()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-diet-exercise.R b/tests/testthat/test-risk-diet-exercise.R index 4878203..d141781 100644 --- a/tests/testthat/test-risk-diet-exercise.R +++ b/tests/testthat/test-risk-diet-exercise.R @@ -1,21 +1,25 @@ #' Test risk-diet-exercise -#' +#' #' This testthat file test the risk-diet-exercise function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- risk_diet_exercise("bmi is healthy, ages 20+", - "all races (includes hispanic)", "both sexes") - + output <- risk_diet_exercise( + "bmi is healthy, ages 20+", + "all races (includes hispanic)", "both sexes" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -diet_exercise_options <- c("bmi is healthy, ages 20+", "bmi is obese, ages 20+", - "bmi is obese, high school survey", "bmi is overweight, high school survey", - "consumed 1 or more fruits per day", "consumed 1 or more vegetables per day", - "no leisure time physical activity") +# Ensures that variables are present and working on SCP +diet_exercise_options <- c( + "bmi is healthy, ages 20+", "bmi is obese, ages 20+", + "bmi is obese, high school survey", "bmi is overweight, high school survey", + "consumed 1 or more fruits per day", "consumed 1 or more vegetables per day", + "no leisure time physical activity" +) for (option in diet_exercise_options) { test_that("risk_diet_exercise returns non-empty data frame", { @@ -25,21 +29,24 @@ for (option in diet_exercise_options) { }) } -#risk-diet-exercise must have 5 columns +# risk-diet-exercise must have 5 columns test_that("risk-diet-exercise has correct number of columns", { skip_on_cran() - df1 <- risk_diet_exercise("bmi is healthy, ages 20+", - "all races (includes hispanic)", "both sexes") - df2 <- risk_diet_exercise("bmi is obese, high school survey", - "all races (includes hispanic)", "males") + df1 <- risk_diet_exercise( + "bmi is healthy, ages 20+", + "all races (includes hispanic)", "both sexes" + ) + df2 <- risk_diet_exercise( + "bmi is obese, high school survey", + "all races (includes hispanic)", "males" + ) expected_columns1 <- 6 expected_columns2 <- 5 expect_equal(ncol(df1), expected_columns1) expect_equal(ncol(df2), expected_columns2) - }) -#parameter +# parameter test_that("risk-diet-exercise has correct parameters", { expect_error(risk_diet_exercise()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-smoking.R b/tests/testthat/test-risk-smoking.R index 238e7fd..e93114d 100644 --- a/tests/testthat/test-risk-smoking.R +++ b/tests/testthat/test-risk-smoking.R @@ -1,23 +1,25 @@ #' Test risk-smoking -#' +#' #' This testthat file test the risk-smoking function -#' -#tests class and typeof output +#' +# tests class and typeof output test_that("Output data type is correct", { skip_on_cran() output <- risk_smoking("smoking laws (any)") - + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP +# Ensures that variables are present and working on SCP -#group1 -smoking_group1_options <- c("smoking laws (any)", - "smoking laws (bars)", - "smoking laws (restaurants)", - "smoking laws (workplace)", - "smoking laws (workplace; restaurant; & bar)") +# group1 +smoking_group1_options <- c( + "smoking laws (any)", + "smoking laws (bars)", + "smoking laws (restaurants)", + "smoking laws (workplace)", + "smoking laws (workplace; restaurant; & bar)" +) for (option in smoking_group1_options) { test_that("smoking group1 returns non-empty data frame", { @@ -27,76 +29,94 @@ for (option in smoking_group1_options) { }) } -#group2 -smoking_group2_options <- c("smokers (stopped for 1 day or longer)", - "smoking not allowed at work (all people)", - "smoking not allowed in home (all people)") +# group2 +smoking_group2_options <- c( + "smokers (stopped for 1 day or longer)", + "smoking not allowed at work (all people)", + "smoking not allowed in home (all people)" +) for (option in smoking_group2_options) { test_that("smoking group2 returns non-empty data frame", { skip_on_cran() - result <- risk_smoking(option, sex="both sexes", datatype="direct estimates") + result <- risk_smoking(option, sex = "both sexes", datatype = "direct estimates") expect_true(is.data.frame(result)) }) } -#group3 -smoking_group3_options <- c("smoking not allowed at work (current smokers)", - "smoking not allowed at work (former/never smokers)", - "smoking not allowed in home (current smokers)", - "smoking not allowed in home (former/never smokers)") +# group3 +smoking_group3_options <- c( + "smoking not allowed at work (current smokers)", + "smoking not allowed at work (former/never smokers)", + "smoking not allowed in home (current smokers)", + "smoking not allowed in home (former/never smokers)" +) for (option in smoking_group3_options) { test_that("smoking group3 returns non-empty data frame", { skip_on_cran() - result <- risk_smoking(option, sex="both sexes", datatype="direct estimates") + result <- risk_smoking(option, sex = "both sexes", datatype = "direct estimates") expect_true(is.data.frame(result)) }) } -#group4 -smoking_group4_options <- c("former smoker; ages 18+", - "former smoker, quit 1 year+; ages 18+") +# group4 +smoking_group4_options <- c( + "former smoker; ages 18+", + "former smoker, quit 1 year+; ages 18+" +) for (option in smoking_group4_options) { test_that("smoking group4 returns non-empty data frame", { skip_on_cran() - result <- risk_smoking(option, sex="both sexes", - datatype="county level modeled estimates", area="ca") + result <- risk_smoking(option, + sex = "both sexes", + datatype = "county level modeled estimates", area = "ca" + ) expect_true(is.data.frame(result)) }) } -#group5 -smoking_group5_options <- c("smokers (ever); ages 18+", - "e-cigarette use; ages 18+") +# group5 +smoking_group5_options <- c( + "smokers (ever); ages 18+", + "e-cigarette use; ages 18+" +) for (option in smoking_group5_options) { test_that("smoking group5 returns non-empty data frame", { skip_on_cran() - result <- risk_smoking(option, race="hispanic (any race)", - sex="both sexes", datatype="direct estimates") + result <- risk_smoking(option, + race = "hispanic (any race)", + sex = "both sexes", datatype = "direct estimates" + ) expect_true(is.data.frame(result)) }) } -#group6 +# group6 test_that("smoking group6 returns non-empty data frame", { skip_on_cran() - result <- risk_smoking("smokers (current); ages 18+", race="hispanic (any race)", - sex="both sexes", datatype="direct estimates") + result <- risk_smoking("smokers (current); ages 18+", + race = "hispanic (any race)", + sex = "both sexes", datatype = "direct estimates" + ) expect_true(is.data.frame(result)) }) -#risk-smoking must have 5 columns +# risk-smoking must have 5 columns test_that("risk-smoking has correct number of columns", { skip_on_cran() df1 <- risk_smoking("smoking laws (any)") - df2 <- risk_smoking("smokers (stopped for 1 day or longer)", sex="both sexes", - datatype="county level modeled estimates", area="wa") - df3 <- risk_smoking("smoking not allowed at work (current smokers)", sex="both sexes", - datatype="direct estimates") + df2 <- risk_smoking("smokers (stopped for 1 day or longer)", + sex = "both sexes", + datatype = "county level modeled estimates", area = "wa" + ) + df3 <- risk_smoking("smoking not allowed at work (current smokers)", + sex = "both sexes", + datatype = "direct estimates" + ) expected_columns1 <- 3 expected_columns2 <- 5 expected_columns3 <- 6 @@ -105,41 +125,48 @@ test_that("risk-smoking has correct number of columns", { expect_equal(ncol(df3), expected_columns3) }) -#test error handling +# test error handling test_that("risk-smoking handles invalid smoking parameters", { skip_on_cran() expect_error( - risk_smoking("smoking laws (any)", sex="both sexes"), + risk_smoking("smoking laws (any)", sex = "both sexes"), "For this smoking type, Race, Sex, Datatype, and Area must ALL be NULL" ) expect_error( - risk_smoking("smokers (stopped for 1 day or longer)", sex="both sexes", - datatype="county level modeled estimates"), + risk_smoking("smokers (stopped for 1 day or longer)", + sex = "both sexes", + datatype = "county level modeled estimates" + ), "For county level modeled estimates on this smoking type, area must NOT be null" ) expect_error( - risk_smoking("smoking not allowed at work (current smokers)", - race="all races (includes hispanic)", sex="both sexes", - datatype="direct estimates"), + risk_smoking("smoking not allowed at work (current smokers)", + race = "all races (includes hispanic)", sex = "both sexes", + datatype = "direct estimates" + ), "For all sexes in this smoking type, race and area should be NULL" ) expect_error( - risk_smoking("former smoker; ages 18+", sex="both sexes", - datatype="county level modeled estimates"), + risk_smoking("former smoker; ages 18+", + sex = "both sexes", + datatype = "county level modeled estimates" + ), "For this smoking type, Sex, Datatype, and Area must not be NULL AND Race must be NULL" ) expect_error( - risk_smoking("smokers (ever); ages 18+", race="hispanic (any race)", sex="both sexes"), + risk_smoking("smokers (ever); ages 18+", race = "hispanic (any race)", sex = "both sexes"), "For this smoking type, Race, Sex, and Datatype must not be NULL AND Datatype and Area must be NULL" ) expect_error( - risk_smoking("smokers (current); ages 18+", race="all races (includes hispanic)", - sex="both sexes", area="wa"), + risk_smoking("smokers (current); ages 18+", + race = "all races (includes hispanic)", + sex = "both sexes", area = "wa" + ), "For all races for this smoking type, Datatype must not be NULL" ) }) -#parameter +# parameter test_that("risk-smoking has correct parameters", { expect_error(risk_smoking()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-vaccines.R b/tests/testthat/test-risk-vaccines.R index 74941bb..e95a511 100644 --- a/tests/testthat/test-risk-vaccines.R +++ b/tests/testthat/test-risk-vaccines.R @@ -5,15 +5,19 @@ # tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- risk_vaccines("percent with up to date hpv vaccination coverage, ages 13-15", - "both sexes") - + output <- risk_vaccines( + "percent with up to date hpv vaccination coverage, ages 13-15", + "both sexes" + ) + expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -vaccine_options <- c("percent with up to date hpv vaccination coverage, ages 13-15", - "percent with up to date hpv vaccination coverage, ages 13-17") +# Ensures that variables are present and working on SCP +vaccine_options <- c( + "percent with up to date hpv vaccination coverage, ages 13-15", + "percent with up to date hpv vaccination coverage, ages 13-17" +) for (option in vaccine_options) { test_that("risk_womens_health returns non-empty data frame", { @@ -23,17 +27,18 @@ for (option in vaccine_options) { }) } -#risk-vaccines must have 5 columns +# risk-vaccines must have 5 columns test_that("risk-vaccines has correct number of columns", { skip_on_cran() - df <- risk_vaccines("percent with up to date hpv vaccination coverage, ages 13-15", - "both sexes") + df <- risk_vaccines( + "percent with up to date hpv vaccination coverage, ages 13-15", + "both sexes" + ) expected_columns <- 6 expect_equal(ncol(df), expected_columns) - }) -#parameter +# parameter test_that("risk-vaccines has correct parameters", { expect_error(risk_vaccines()) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-risk-womens-health.R b/tests/testthat/test-risk-womens-health.R index d6a54fa..a46aedc 100644 --- a/tests/testthat/test-risk-womens-health.R +++ b/tests/testthat/test-risk-womens-health.R @@ -5,16 +5,20 @@ # tests class and typeof output test_that("Output data type is correct", { skip_on_cran() - output <- risk_women_health("mammogram in past 2 years, ages 50-74", - "all races (includes hispanic)", "direct estimates") + output <- risk_women_health( + "mammogram in past 2 years, ages 50-74", + "all races (includes hispanic)", "direct estimates" + ) expect_true(inherits(output, "data.frame")) }) -#Ensures that variables are present and working on SCP -womens_health_options <- c("mammogram in past 2 years, ages 50-74", - "mammogram in past 2 years, ages 40+", - "pap smear in past 3 years, no hysterectomy, ages 21-65") +# Ensures that variables are present and working on SCP +womens_health_options <- c( + "mammogram in past 2 years, ages 50-74", + "mammogram in past 2 years, ages 40+", + "pap smear in past 3 years, no hysterectomy, ages 21-65" +) for (option in womens_health_options) { test_that("risk_womens_health returns non-empty data frame", { @@ -24,22 +28,25 @@ for (option in womens_health_options) { }) } -#risk-womens health must have 5 columns +# risk-womens health must have 5 columns test_that("risk-womens health has correct number of columns", { skip_on_cran() - df1 <- risk_women_health("mammogram in past 2 years, ages 50-74", - "all races (includes hispanic)", "direct estimates") - df2 <- risk_women_health("mammogram in past 2 years, ages 50-74", - "all races (includes hispanic)", "county level modeled estimates", "wa") - + df1 <- risk_women_health( + "mammogram in past 2 years, ages 50-74", + "all races (includes hispanic)", "direct estimates" + ) + df2 <- risk_women_health( + "mammogram in past 2 years, ages 50-74", + "all races (includes hispanic)", "county level modeled estimates", "wa" + ) + expected_columns1 <- 6 expected_columns2 <- 5 expect_equal(ncol(df1), expected_columns1) expect_equal(ncol(df2), expected_columns2) - }) -#parameter +# parameter test_that("risk-womens health has correct parameters", { expect_error(risk_women_health()) -}) \ No newline at end of file +}) diff --git a/vignettes/demographics-vignette.Rmd b/vignettes/demographics-vignette.Rmd index adc948c..10fb43d 100644 --- a/vignettes/demographics-vignette.Rmd +++ b/vignettes/demographics-vignette.Rmd @@ -31,11 +31,13 @@ Each of these functions require various parameters that must be specified to pul Demo crowding **Always** requires 4 arguments: area, areatype, crowding, and race ```{r crowding} -crowding <- demo_crowding(area = "WA", - areatype = "county", - crowding = "household with >1 person per room", - race = "All Races (includes Hispanic)") -head(crowding, n=3) +crowding <- demo_crowding( + area = "WA", + areatype = "county", + crowding = "household with >1 person per room", + race = "All Races (includes Hispanic)" +) +head(crowding, n = 3) ``` ### Demo Education @@ -43,70 +45,84 @@ Demo education has 5 arguments: area, areatype, education, sex, race. **Depending on the education argument, the required arguments will change** ```{r education} -#at least high school - requires arguments: area, areatype, education, sex -education1 <- demo_education(area = "wa", - areatype = "county", - education = "at least high school", - sex = "males") +# at least high school - requires arguments: area, areatype, education, sex +education1 <- demo_education( + area = "wa", + areatype = "county", + education = "at least high school", + sex = "males" +) -head(education1, n=3) +head(education1, n = 3) -#at least bachelors degree - requires arguments: area, areatype, education, sex, race -education2 <- demo_education(area = "usa", - areatype = "state", - education = "at least bachelors degree", - sex = "both sexes", - race = "all races (includes hispanic)") +# at least bachelors degree - requires arguments: area, areatype, education, sex, race +education2 <- demo_education( + area = "usa", + areatype = "state", + education = "at least bachelors degree", + sex = "both sexes", + race = "all races (includes hispanic)" +) -head(education2, n=3) +head(education2, n = 3) -#less than 9th grade - requires arguments: area, areatype, education -education3 <- demo_education(area = "pr", - areatype = "hsa", - education = "less than 9th grade") +# less than 9th grade - requires arguments: area, areatype, education +education3 <- demo_education( + area = "pr", + areatype = "hsa", + education = "less than 9th grade" +) -head(education3, n=3) +head(education3, n = 3) ``` ### Demo Food Demo food has 4 arguments: area, areatype, food, race. ```{r food} -#limited access to healthy food - requires arguments: area, areatype, food -food1 <- demo_food(area = "usa", - areatype = "state", - food = "limited access to healthy food") +# limited access to healthy food - requires arguments: area, areatype, food +food1 <- demo_food( + area = "usa", + areatype = "state", + food = "limited access to healthy food" +) -head(food1, n=3) +head(food1, n = 3) -#food insecurity - requires arguments: area, areatype, food, race -food2 <- demo_food(area = "pr", - areatype = "county", - food = "food insecurity", - race = "all races (includes hispanic)") +# food insecurity - requires arguments: area, areatype, food, race +food2 <- demo_food( + area = "pr", + areatype = "county", + food = "food insecurity", + race = "all races (includes hispanic)" +) -head(food2, n=3) +head(food2, n = 3) ``` ### Demo Income Demo income **Always** requires 4 arguments: area, areatype, income, race. ```{r income} -#limited access to healthy food - requires arguments: area, areatype, food -income1 <- demo_income(area = "wa", - areatype = "county", - income = "median household income", - race = "all races (includes hispanic)") +# limited access to healthy food - requires arguments: area, areatype, food +income1 <- demo_income( + area = "wa", + areatype = "county", + income = "median household income", + race = "all races (includes hispanic)" +) -head(income1, n=3) +head(income1, n = 3) -#food insecurity - requires arguments: area, areatype, food, race -income2 <- demo_income(area = "usa", - areatype = "state", - income = "median family income", - race = "all races (includes hispanic)") +# food insecurity - requires arguments: area, areatype, food, race +income2 <- demo_income( + area = "usa", + areatype = "state", + income = "median family income", + race = "all races (includes hispanic)" +) -head(income2, n=3) +head(income2, n = 3) ``` ### Demo Insurance @@ -118,58 +134,70 @@ Check function documentations for more details Only Areatype "State" can select Race, otherwise race should always be "all races (includes hispanic) ```{r insurance} -insurance1 <- demo_insurance(area = "usa", - areatype = "state", - insurance = "% Insured in demographic group, all income levels", - sex = "both sexes", - age = "18 to 64 years", - race = "white (non-hispanic)") - -head(insurance1, n=3) - -insurance2 <- demo_insurance(area = "wa", - areatype = "county", - insurance = "% Insured in demographic group, all income levels", - sex = "males", - age = "18 to 64 years") - -head(insurance2, n=3) +insurance1 <- demo_insurance( + area = "usa", + areatype = "state", + insurance = "% Insured in demographic group, all income levels", + sex = "both sexes", + age = "18 to 64 years", + race = "white (non-hispanic)" +) + +head(insurance1, n = 3) + +insurance2 <- demo_insurance( + area = "wa", + areatype = "county", + insurance = "% Insured in demographic group, all income levels", + sex = "males", + age = "18 to 64 years" +) + +head(insurance2, n = 3) ``` ### Demo Mobility Demo mobility **Always** requires 3 arguments: area, areatype, mobility. The function defaults to "all races", "both sexes", "ages 1+" ```{r mobility} -mobility1 <- demo_mobility(area = "usa", - areatype = "state", - mobility = "moved, same county (in past year)") +mobility1 <- demo_mobility( + area = "usa", + areatype = "state", + mobility = "moved, same county (in past year)" +) -head(mobility1, n=3) +head(mobility1, n = 3) -mobility2 <- demo_mobility(area = "WA", - areatype = "county", - mobility = "moved, different county, same state (in past year)") +mobility2 <- demo_mobility( + area = "WA", + areatype = "county", + mobility = "moved, different county, same state (in past year)" +) -head(mobility2, n=3) +head(mobility2, n = 3) ``` ### Demo Language Demo Language **Always** requires 3 arguments: area, areatype, language. The function defaults to "all races", "both sexes", "ages 14+" ```{r Language} -non_english1 <- demo_language(area = "wa", - areatype = "county", - language = "language isolation") +non_english1 <- demo_language( + area = "wa", + areatype = "county", + language = "language isolation" +) -head(non_english1, n=3) +head(non_english1, n = 3) -non_english2 <- demo_language(area = "usa", - areatype = "state", - language = "language isolation") +non_english2 <- demo_language( + area = "usa", + areatype = "state", + language = "language isolation" +) -head(non_english2, n=3) +head(non_english2, n = 3) ``` ### Demo Population @@ -179,29 +207,35 @@ Demo Population has 5 arguments: area, areatype, population, race, sex. The popu ```{r population} # -population1 <- demo_population(area = "wa", - areatype = "county", - population = "foreign born", - race = "black", - sex = "females") +population1 <- demo_population( + area = "wa", + areatype = "county", + population = "foreign born", + race = "black", + sex = "females" +) -head(population1, n=3) +head(population1, n = 3) -population2 <- demo_population(area = "ca", - areatype = "county", - population = "males", - race = "all races (includes hispanic)") +population2 <- demo_population( + area = "ca", + areatype = "county", + population = "males", + race = "all races (includes hispanic)" +) -head(population2, n=3) +head(population2, n = 3) -population3 <- demo_population(area = "usa", - areatype = "state", - population = "age under 18", - race = "all races (includes hispanic)", - sex = "both sexes") +population3 <- demo_population( + area = "usa", + areatype = "state", + population = "age under 18", + race = "all races (includes hispanic)", + sex = "both sexes" +) -head(population3, n=3) +head(population3, n = 3) ``` ### Demo Poverty @@ -214,29 +248,35 @@ The "families below poverty" poverty argument will require a race argument and d The "persons below poverty" poverty argument will require a race argument and a sex argument, and default to "all ages". ```{r poverty} -#Persistent poverty -poverty1 <- demo_poverty(area = "WA", - areatype = "county", - poverty = "persistent poverty") +# Persistent poverty +poverty1 <- demo_poverty( + area = "WA", + areatype = "county", + poverty = "persistent poverty" +) -head(poverty1, n=3) +head(poverty1, n = 3) -#Families below poverty -poverty2 <- demo_poverty(area = "usa", - areatype = "state", - poverty = "families below poverty", - race = "black") +# Families below poverty +poverty2 <- demo_poverty( + area = "usa", + areatype = "state", + poverty = "families below poverty", + race = "black" +) -head(poverty2, n=3) +head(poverty2, n = 3) -#Persons below poverty -poverty3 <- demo_poverty(area = "usa", - areatype = "state", - poverty = "persons below poverty", - race = "black", - sex = "males") +# Persons below poverty +poverty3 <- demo_poverty( + area = "usa", + areatype = "state", + poverty = "persons below poverty", + race = "black", + sex = "males" +) -head(poverty3, n=3) +head(poverty3, n = 3) ``` ### Demo Social Vulnerability Index (SVI) @@ -245,36 +285,44 @@ Demo svi **Always** requires 2 arguments: area, svi. The function defaults to "a *Please note that the areatype argument is not available for this function because areatype is limited to "county"* ```{r svi} -svi1 <- demo_svi(area = "WA", - svi = "overall") +svi1 <- demo_svi( + area = "WA", + svi = "overall" +) -head(svi1, n=3) +head(svi1, n = 3) -svi2 <- demo_svi(area = "usa", - svi = "socioeconomic status") +svi2 <- demo_svi( + area = "usa", + svi = "socioeconomic status" +) -head(svi2, n=3) +head(svi2, n = 3) ``` ### Workforce Demo svi **Always** requires 5 arguments: area, areatype, workforce, race, sex. The function defaults to "ages 16+" ```{r workforce} -workforce1 <- demo_workforce(area = "WA", - areatype = "county", - workforce = "unemployed", - race = "all races (includes hispanic)", - sex = "both sexes") +workforce1 <- demo_workforce( + area = "WA", + areatype = "county", + workforce = "unemployed", + race = "all races (includes hispanic)", + sex = "both sexes" +) -head(workforce1, n=3) +head(workforce1, n = 3) -workforce2 <- demo_workforce(area = "usa", - areatype = "state", - workforce = "unemployed", - race = "all races (includes hispanic)", - sex = "females") +workforce2 <- demo_workforce( + area = "usa", + areatype = "state", + workforce = "unemployed", + race = "all races (includes hispanic)", + sex = "females" +) -head(workforce2, n=3) -``` \ No newline at end of file +head(workforce2, n = 3) +``` diff --git a/vignettes/risks-vignette.Rmd b/vignettes/risks-vignette.Rmd index 7639c04..62975ce 100644 --- a/vignettes/risks-vignette.Rmd +++ b/vignettes/risks-vignette.Rmd @@ -38,11 +38,15 @@ Each of these functions require various parameters that must be specified to pul Risk Alcohol requires 3 arguments: alcohol, race, sex ```{r alcohol} -alcohol1 <- risk_alcohol(alcohol = paste("binge drinking (4+ drinks on one occasion for women,", - "5+ drinks for one occasion for men), ages 21+"), - race = "all races (includes hispanic)", - sex = "both sexes") -head(alcohol1, n=3) +alcohol1 <- risk_alcohol( + alcohol = paste( + "binge drinking (4+ drinks on one occasion for women,", + "5+ drinks for one occasion for men), ages 21+" + ), + race = "all races (includes hispanic)", + sex = "both sexes" +) +head(alcohol1, n = 3) ``` ### Risk Colorectal Screening @@ -53,14 +57,18 @@ Risk Colorectal Screening has 4 arguments: screening, race, sex, area "ever had fobt, ages 50-75", "guidance sufficient crc, ages 50-75", "had colonoscopy in past 10 years, ages 50-75" for the screening arguments defaults to "all races", "both sexes", and "county level modeled estimates" ```{r colorectal screening} -screening1 <- risk_colorectal_screening(screening = "home blood stool test in the past year, ages 45-75", - race = "all races (includes hispanic)", - sex = "both sexes") -head(screening1, n=3) - -screening2 <- risk_colorectal_screening(screening = "ever had fobt, ages 50-75", - area="usa") -head(screening2, n=3) +screening1 <- risk_colorectal_screening( + screening = "home blood stool test in the past year, ages 45-75", + race = "all races (includes hispanic)", + sex = "both sexes" +) +head(screening1, n = 3) + +screening2 <- risk_colorectal_screening( + screening = "ever had fobt, ages 50-75", + area = "usa" +) +head(screening2, n = 3) ```