R/summarized.R
combined_buyer_annual.Rd
Get annual total pills for each buyer (pharmacy, etc) in a county
combined_buyer_annual(county = "Mingo", state = "WV", key = "WaPo")
Filter the data to only this county (e.g. 'Mingo')
Filter the data to county within this state (e.g. 'WV')
Key needed to make query successful
# \donttest{
library(arcos)
mingo_wv <- combined_buyer_annual(county = "Mingo", state="WV", key="WaPo")
head(mingo_wv)
#> BUYER_DEA_NO BUYER_BUS_ACT BUYER_COUNTY BUYER_STATE year DOSAGE_UNIT
#> 1 AA8151728 RETAIL PHARMACY MINGO WV 2006 279800
#> 2 AA8151728 RETAIL PHARMACY MINGO WV 2007 252400
#> 3 AA8151728 RETAIL PHARMACY MINGO WV 2008 219400
#> 4 AA8151728 RETAIL PHARMACY MINGO WV 2009 192000
#> 5 AA8151728 RETAIL PHARMACY MINGO WV 2010 181600
#> 6 AA8151728 RETAIL PHARMACY MINGO WV 2011 211800
# }