socdataR / wonderapi

Assists in making queries to CDC Wonder API
https://socdatar.github.io/wonderapi/
23 stars 14 forks source link

Bridged-Race Population Estimates (Table D163) #11

Open wdefreitas opened 3 years ago

wdefreitas commented 3 years ago

Wondering if we can use the wonderapi package to query the Bridged-Race Population Estimates (Table D163)?

jtr13 commented 3 years ago

Sorry for the delay... I didn't have the email notifications set up properly.

You can do this:

library(wonderapi)
mydata <- getData(TRUE, "D66", list(list("Group Results By", "D66.V2 "),
                                    list("Year", "2019")))
mydata
#> # A tibble: 4 × 2
#>   `Mother's Bridged Race`           Births
#>   <chr>                              <dbl>
#> 1 American Indian or Alaska Native   41750
#> 2 Asian or Pacific Islander         280702
#> 3 Black or African American         634642
#> 4 White                            2790446

Created on 2021-10-28 by the reprex package (v2.0.1)

But doesn't sound like that's what you want. I'm working on adding the "Natality 2016-2019, Expanded" dataset (https://wonder.cdc.gov/controller/datarequest/D149) but ran into trouble figuring out the right parameters to send. I have default queries now from the CDC so I'll give it another go as soon as I get a chance.