Skip to content

Commit

Permalink
Merge pull request #64 from getwilds/demo-documentation
Browse files Browse the repository at this point in the history
edited demo documentations
  • Loading branch information
realbp authored Mar 6, 2024
2 parents ebee159 + 4c17455 commit 444c898
Show file tree
Hide file tree
Showing 40 changed files with 991 additions and 353 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export(risk_vaccines)
export(risk_women_health)
importFrom(cdlTools,fips)
importFrom(cli,cli_abort)
importFrom(dplyr,across)
importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
Expand Down
20 changes: 11 additions & 9 deletions R/demo-crowding.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
#' Cancer Profiles.
#'
#' @param area A state/territory abbreviation or USA.
#' @param areatype Either `"county"`, `"hsa"` (Health Service Area), or
#' `"state"`.
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @param crowding The only permissible value is
#' `"household with >1 person per room"`.
#' @param race
#' One of the following values:
#' - "All Races (includes Hispanic)"
#' - "White (includes Hispanic)"
#' - "White Non-Hispanic"
#' - "Black"
#' - "Amer. Indian/Alaskan Native (includes Hispanic)"
#' - "Asian or Pacific Islander (includes Hispanic)"
#' - "Hispanic (Any Race)"
#' - `"All Races (includes Hispanic)"`
#' - `"White (includes Hispanic)"`
#' - `"White Non-Hispanic"`
#' - `"Black"`
#' - `"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
Expand Down
30 changes: 22 additions & 8 deletions R/demo-education.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
#' Access to Education Data
#'
#' This function returns a data frame from Education in 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 Either "county", "hsa" (Health service area), or "state"
#' @param education Either "less than 9th grade", "at least high school", "at least bachelors degree"
#' @param sex Either "both sexes", "male", "female"
#' @param race One of the following values: "All Races (includes Hispanic)", "white (includes hispanic)",
#' "white non-hispanic","black","amer. indian/alaskan native (includes hispanic)",
#' "asian or pacific islander (includes hispanic)","hispanic (any race)
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @param education One of the following values:
#' - `"less than 9th grade"`
#' - `"at least high school"`
#' - `"at least bachelors degree"`.
#' @param sex One of the following values:
#' - `"both sexes"`
#' - `"male"`
#' - `"female"`.
#' @param race One of the following values:
#' - `"All Races (includes Hispanic)"`
#' - `"White (includes Hispanic)"`
#' - `"White non-Hispanic"`
#' - `"Black"`
#' - `"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 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
#'
Expand Down
17 changes: 11 additions & 6 deletions R/demo-food-access.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#' Access to Food Insecurity Data
#'
#' This function returns a data frame from Food Insecurity in 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 Either "food insecurity" or "limited access to healthy food"
#' @param race One of the following values: "All Races (includes Hispanic)", "white non hispanic",
#' "black (includes hispanic)","hispanic (any race)
#' @param areatype Either `"county"` or `"state"`.
#' @param food One of the following values:
#' - `"food insecurity"`
#' - `"limited access to healthy food"`.
#' @param race One of the following values:
#' - `"All Races (includes Hispanic)"`
#' - `"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
#'
Expand Down
19 changes: 12 additions & 7 deletions R/demo-income.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#' Access to Income Data
#'
#' This function returns a data frame from Income in 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"
#' @param income Either "median family income" or "median household income"
#' @param race One of the following values: "All Races (includes Hispanic)", "white (includes hispanic)",
#' "white non-hispanic","black","amer. indian/alaskan native (includes hispanic)",
#' "asian or pacific islander (includes hispanic)","hispanic (any race)
#' @param areatype Either `"county"` or `"state"`.
#' @param income Either `"median family income"` or `"median household income"`.
#' @param race One of the following values:
#' - `"All Races (includes Hispanic)"`
#' - `"White (includes Hispanic)"`
#' - `"White non-Hispanic"`
#' - `"Black"`
#' - `"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
#'
Expand Down
58 changes: 43 additions & 15 deletions R/demo-insurance.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,54 @@
#' Access to Insurance Data
#'
#' This function returns a data frame from Insurance in State Cancer Profiles
#' This function returns a data frame about insurance demographics from State Cancer Profiles.
#'
#' @param area A state/territory abbreviation or USA.
#' @param areatype Either "county", "hsa" (Health service area), or "state"
#' @param insurance Either
#' "% 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"
#' @param sex Either "both sexes", "male", "female"
#' @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" for "both sexes"
#' "18 to 64 years","40 to 64 years","50 to 64 years","Under 65 years" for "males" and "females"
#' @param race Either "all races (includes hispanic)", "white (non-hispanic)", "black (non-hispanic)", "american indian / alaska native non-hispanic",
#' "asian (non-hispanic)", "hispanic (any race)"
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @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"`.
#' @param sex One of the following values:
#' - `"both sexes"`
#' - `"male"`
#' - `"female"`.
#' @param age If you specified `"both sexes"` for `sex` choose 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"`.
#'
#' Otherwise if you specified `"male"` or `"female"` for `sex`, choose one of the following values:
#' - `"18 to 64 years"`
#' - `"40 to 64 years"`
#' - `"50 to 64 years"`
#' - `"Under 65 years"`.
#' @param race Only specify `race` if you specified `"state"` for `areatype`
#' - `"All Races (includes Hispanic)"`
#' - `"White (non-Hispanic)"`
#' - `"black (non-Hispanic)"`
#' - `"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"
#' @returns A data frame with the following columns: Area Type, Area Code, Percent, People, Rank.
#'
#' @export
#'
Expand Down
18 changes: 12 additions & 6 deletions R/demo-mobility.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#' Access to Mobility Data
#'
#' This function returns a data frame from mobility in 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 Either "county", "hsa" (Health service area), or "state"
#' @param mobility One of five choices from "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)"
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @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
#'
Expand Down
12 changes: 8 additions & 4 deletions R/demo-non-english-language.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#' Access to Non-English Language
#'
#' This function returns a data frame from Crowding in 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 Either "county", "hsa" (Health service area), or "state"
#' @param language "language isolation"
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @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
#'
Expand Down
43 changes: 34 additions & 9 deletions R/demo-population.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
#' Access to Population Data
#'
#' This function returns a data frame from population in State Cancer Profiles
#' This function returns a data frame from population in State Cancer Profiles.
#'
#' @param area A state/territory abbreviation or USA.
#' @param areatype Either "county", "hsa" (Health service area), or "state"
#' @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"
#' @param race One of the following values: "american indian/alaska native", "asian/pacific islander",
#' "black", "hispanic", "white (includes hispanic)", "white non-hispanic", "hispanic (any race)"
#' @param sex Either "both sexes", "males", "females"
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @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"`.
#' @param race One of the following values:
#' - `"American Indian/Alaska Native"`
#' - `"Asian/Pacific Islander"`
#' - `"Black"`
#' - `"Hispanic"`
#' - `"White (includes Hispanic)"`
#' - `"White non-Hispanic"`
#' - `"Hispanic (Any Race)"`.
#' @param sex One of the following values:
#' - `"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
#'
Expand Down
31 changes: 23 additions & 8 deletions R/demo-poverty.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
#' Access to Poverty Data
#'
#' This function returns a data frame from Poverty in 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 Either "county", "hsa" (Health service area), or "state"
#' @param poverty Either "families below poverty", "persistent poverty", "persons below poverty", "persons < 150% of poverty"
#' @param race One of the following values: "All Races (includes Hispanic)", "white (includes hispanic)",
#' "white non-hispanic","black","amer. indian/alaskan native (includes hispanic)",
#' "asian or pacific islander (includes hispanic)","hispanic (any race)
#' @param sex Either "both sexes", "male", "female"
#' @param areatype One of the following values:
#' - `"county"`
#' - `"hsa"` (Health Service Area)
#' - `"state"`.
#' @param poverty One of the following values:
#' - `"families below poverty"`
#' - `"persistent poverty"`
#' - `"persons below poverty"`
#' - `"persons < 150% of poverty"`.
#' @param race One of the following values:
#' - `"All Races (includes Hispanic)"`
#' - `"White (includes Hispanic)"`
#' - `"White non-Hispanic"`
#' - `"Black"`
#' - `"Amer. Indian/Alaskan Native (includes Hispanic)"`
#' - `"Asian or Pacific Islander (includes Hispanic)"`
#' - `"Hispanic (Any Race)`.
#' @param sex One of the following values
#' - `"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
#'
Expand Down
11 changes: 8 additions & 3 deletions R/demo-svi.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#' 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 from social vulnerability index (SVI) in State Cancer Profiles.
#'
#' @param area A state/territory abbreviation or USA.
#' @param svi Either "Overall", "socioeconomic status", "household characteristics", "racial & ethinic minority status", "housing type & transportation"
#' @param svi One of the following values:
#' - `"Overall"`
#' - `"socioeconomic status"`
#' - `"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
#'
Expand Down
Loading

0 comments on commit 444c898

Please sign in to comment.