Function Resource

CaliforniaCOVID19Data

Generate datasets from California COVID19 released by CA government

ResourceFunction["CaliforniaCOVID19Data"][arg]

returns the COVID19 dataset for arg.

Details and Options

The arg can be "Testing", "Hospitals", "Cases", "Age", "Sex", or "Ethnicity" as a string, or any combination of them as a list. If arg is given as a string, the corresponding dataset is returned; with arg as a list, an association is returned with keys as elements of arg, and values the corresponding datasets.
ResourceFunction["CaliforniaCOVID19Data"] takes the option "Dictionary". By default, it is False; if True, the function returns the corresponding data dictionary.
The data is scrapped from the California goverment COVID19 data source.

Examples

Basic Examples (5) 

Get the testing dataset:

In[1]:=
testing = ResourceFunction[
   "https://www.wolframcloud.com/obj/mohammadb/DeployedResources/\
Function/CaliforniaCOVID19Data"]["Testing"];

Visualize testing:

In[2]:=
DateListPlot[Differences[testing], PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "Daily COVID19 Tests Reported, California", Filling -> Bottom]
Out[2]=

Get COVID19 confirmed cases dataset:

In[3]:=
cases = ResourceFunction[
   "https://www.wolframcloud.com/obj/mohammadb/DeployedResources/\
Function/CaliforniaCOVID19Data"]["Cases"];

Visualize daily cases:

In[4]:=
DateListPlot[Differences[cases[Total, "TotalCases"]], PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "Daily COVID19 Confirmed Cases, California", Filling -> Bottom]
Out[4]=

Visualize the fraction of test positivity:

In[5]:=
DateListPlot[
 Differences[cases[Total, "TotalCases"]]/Differences[testing], PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "Fraction of Daily COVID19 Tests Came Positive (Test Positivity), \
California", Filling -> Bottom]
Out[5]=

Scope (3) 

Get CA hospitals data:

In[6]:=
hospitals = ResourceFunction[
   "https://www.wolframcloud.com/obj/mohammadb/DeployedResources/\
Function/CaliforniaCOVID19Data"]["Hospitals"];

Visualize the hospitalization due to covid19:

In[7]:=
DateListPlot[hospitals[Total, "HospitalizedCovidConfirmedPatients"], PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "Hospitalized COVID19-Confirmed Patients, California", Filling -> Bottom, PlotRange -> All]
Out[7]=

Fraction of Hospitalized COVID19 Patients Admitted to ICU:

In[8]:=
DateListPlot[hospitals[Total, "ICUCovidConfirmedPatients"]/
 hospitals[Total, "HospitalizedCovidConfirmedPatients"], PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "Fraction of Hospitalized COVID19 Patients Admitted to ICU, \
California", Filling -> Bottom]
Out[8]=

Options (1) 

Dictionary (1) 

Use "Dictionary" to get the corresponding data dictionary:

In[9]:=
ResourceFunction[
 "https://www.wolframcloud.com/obj/mohammadb/DeployedResources/\
Function/CaliforniaCOVID19Data"]["Hospitals", "Dictionary" -> True]
Out[9]=

Neat Examples (1) 

Visualize the ICU COVID19 patients and ICU available beds:

In[10]:=
hospitals = ResourceFunction[
   "https://www.wolframcloud.com/obj/mohammadb/DeployedResources/\
Function/CaliforniaCOVID19Data"]["Hospitals"];
In[11]:=
DateListPlot[{hospitals[Total, "ICUCovidConfirmedPatients"], hospitals[Total, "ICUAvailableBeds"]}, PlotTheme -> "Business", AspectRatio -> 1/4, ImageSize -> Large, PlotLabel -> "ICU Available Beds and ICU COVID19-Patients, California", PlotLegends -> {"ICU COVID19-Patients", "Available ICU Beds"}, Filling -> Bottom]
Out[11]=

Source Metadata