StateOfCalifornia / CalCAT

California Communicable diseases Assessment Tool
MIT License
225 stars 101 forks source link

importing data via JSON #36

Open kfabian2021 opened 1 year ago

kfabian2021 commented 1 year ago

Hello, I recently discovered this tool (very cool!) and have just started working with it to see if I can run it with data from Washington state. I've created a fork in the branch and input "Washington" where instructed, but am running into an issue running the cal_cat_data_routine markdown file.

Specifically, in the grab_can_state_observed_intervention formula I'm unable to import the data from data.covidactnow.org (can.ca <- jsonlite::fromJSON(paste0("https://data.covidactnow.org/latest/us/states/",get_state_abbrv(State),".OBSERVED_INTERVENTION.timeseries.json"))$timeseries). The result is an empty data.frame. Do I need to set up an API with them in order to access these data?

Also as a side question, is there code in your github to recreate your ensemble models for Flu?

Thanks, Katrin from Public Health Seattle & King County

tomasleon commented 1 year ago

Hi Katrin,

Thanks for your interest in the CalCAT Open Source project!

You would indeed need to set up your own API; however, what CovidActNow makes available has changed since this code was written. See: https://covidactnow.org/

We are actually planning a repo update for ~2nd week of November that will obviate the need for the CAN API. Old stuff will be removed and new stuff will be added. Re:ensemble model creation code, we are working on it...

Regards Tomas (tomas.leon [at] cdph.ca.gov).

PS: Feel free to follow up by email to calcat [at] cdph.ca.gov and cc me.