getwilds / cancerprof

API Client for State Cancer Profiles
http://getwilds.org/cancerprof/
Other
2 stars 3 forks source link

Reduce duplication #63

Closed sckott closed 6 months ago

sckott commented 7 months ago

e..g, the 4 process_* functions. they share a lot of the same code, and that common code could be factored out. but I haven't looked at the 4 fxns in detail so it's possible it's not worth it

howardbaik commented 7 months ago

Also, these lines of code are repeated in a couple of the demo_XXX functions:

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]

They could be wrapped in an utility function, located inside utils.R.