Skip to content

Commit 0169dee

Browse files
committed
Merge remote-tracking branch 'origin/dev' into sgratzl/docker2
2 parents 2886efb + 801a067 commit 0169dee

File tree

17 files changed

+5906
-6935
lines changed

17 files changed

+5906
-6935
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
${{ runner.os }}-conda6-
2525
- uses: conda-incubator/setup-miniconda@v2
2626
with:
27-
python-version: 3.7
27+
python-version: 3.9
2828
mamba-version: "*"
2929
channels: conda-forge,defaults
3030
channel-priority: true

content/blog/2020-08-26-fb-survey.Rmd

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,23 @@ df_in = covidcast_signal("jhu-csse", "confirmed_7dav_incidence_prop",
149149
df_fb_avg = df_fb %>% group_by(geo_value) %>% summarize(value = mean(value))
150150
df_in_avg = df_in %>% group_by(geo_value) %>% summarize(value = mean(value))
151151
152-
# Set a bunch of fields so that the data frames know how to plot themselves
153-
df_fb_avg$time_value = df_in_avg$time_value = start_day
154-
df_fb_avg$issue = df_in_avg$issue = start_day
155-
attributes(df_fb_avg)$metadata$geo_type = "state"
156-
attributes(df_in_avg)$metadata$geo_type = "state"
157-
class(df_fb_avg) = c("covidcast_signal", class(df_fb_avg))
158-
class(df_in_avg) = c("covidcast_signal", class(df_in_avg))
152+
# Turn these into covidcast_signal data frames that can be mapped
153+
df_fb_avg = df_fb_avg %>%
154+
mutate(time_value = start_day) %>%
155+
as.covidcast_signal(signal = "fb_avg", geo_type = "state")
156+
157+
df_in_avg = df_in_avg %>%
158+
mutate(time_value = start_day) %>%
159+
as.covidcast_signal(signal = "in_avg", geo_type = "state")
159160
160161
# Plot choropleth maps, using the covidcast plotting functionality
161162
subtitle = paste("Averaged over", start_day, "to", end_day)
162163
p1 = plot(df_fb_avg,
163164
title = "% of people with COVID symptoms, based on Facebook surveys",
164-
range=c(0, 1), choro_params = list(subtitle = subtitle))
165+
range = c(0, 1), choro_params = list(subtitle = subtitle))
165166
p2 = plot(df_in_avg,
166167
title = "Daily new confirmed COVID-19 cases per 100,000 people",
167-
range=c(0, 30), choro_params = list(subtitle = subtitle))
168+
range = c(0, 30), choro_params = list(subtitle = subtitle))
168169
grid.arrange(p1, p2, nrow = 1)
169170
```
170171

@@ -539,12 +540,13 @@ or we didn't have enough data from the surveys in
539540
order to estimate % CLI and % CLI-in-community signals there.
540541

541542
```{r, fig.width = 10, fig.height = 4, out.extra = 'class="wide-figure"'}
542-
# Set a bunch of fields so that the data frames know how to plot themselves
543-
df_cor1$time_value = df_cor2$time_value = start_day
544-
df_cor1$issue = df_cor2$issue = start_day
545-
attributes(df_cor1)$metadata$geo_type = "county"
546-
attributes(df_cor2)$metadata$geo_type = "county"
547-
class(df_cor1) = class(df_cor2) = c("covidcast_signal", "data.frame")
543+
# Use as.covidcast_signal to turn these into mappable signals
544+
df_cor1 = df_cor1 %>%
545+
mutate(time_value = start_day) %>%
546+
as.covidcast_signal(signal = "cor1")
547+
df_cor2 = df_cor2 %>%
548+
mutate(time_value = start_day) %>%
549+
as.covidcast_signal(signal = "cor1")
548550
549551
# Plot choropleth maps, using the covidcast plotting functionality
550552
p1 = plot(df_cor1, title = "Correlation between % CLI and case rates",

content/blog/2020-08-26-fb-survey.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
survey data. The COVIDcast API, which serves these estimates and is updated
3737
daily, is a much larger effort run by the Delphi group, and our entire
3838
engineering team is owed a lot of credit here. Ryan came up with the
39-
idea of running the surveys, and worked with Facebook to make this a reality.
39+
idea of running the surveys, and worked with Facebook to make this a reality.
4040
On the Facebook side, Curtiss Cobb and Jonathan McKay played big roles. The
4141
University of Maryland team, including Adrianne Bradford and Samantha Chiu and
4242
led by Frauke Kreuter, made many contributions to the survey design.
@@ -47,7 +47,6 @@
4747
toc: true
4848
---
4949

50-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
5150
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
5251
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
5352

@@ -57,8 +56,7 @@
5756
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
5857
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
5958
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
60-
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
61-
<ul>
59+
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a><ul>
6260
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
6361
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
6462
</ul></li>
@@ -156,22 +154,23 @@ <h2>Short Background</h2>
156154
df_fb_avg = df_fb %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
157155
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
158156

159-
# Set a bunch of fields so that the data frames know how to plot themselves
160-
df_fb_avg$time_value = df_in_avg$time_value = start_day
161-
df_fb_avg$issue = df_in_avg$issue = start_day
162-
attributes(df_fb_avg)$metadata$geo_type = &quot;state&quot;
163-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
164-
class(df_fb_avg) = c(&quot;covidcast_signal&quot;, class(df_fb_avg))
165-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
157+
# Turn these into covidcast_signal data frames that can be mapped
158+
df_fb_avg = df_fb_avg %&gt;%
159+
mutate(time_value = start_day) %&gt;%
160+
as.covidcast_signal(signal = &quot;fb_avg&quot;, geo_type = &quot;state&quot;)
161+
162+
df_in_avg = df_in_avg %&gt;%
163+
mutate(time_value = start_day) %&gt;%
164+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
166165

167166
# Plot choropleth maps, using the covidcast plotting functionality
168167
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
169168
p1 = plot(df_fb_avg,
170169
title = &quot;% of people with COVID symptoms, based on Facebook surveys&quot;,
171-
range=c(0, 1), choro_params = list(subtitle = subtitle))
170+
range = c(0, 1), choro_params = list(subtitle = subtitle))
172171
p2 = plot(df_in_avg,
173172
title = &quot;Daily new confirmed COVID-19 cases per 100,000 people&quot;,
174-
range=c(0, 30), choro_params = list(subtitle = subtitle))
173+
range = c(0, 30), choro_params = list(subtitle = subtitle))
175174
grid.arrange(p1, p2, nrow = 1)</code></pre>
176175
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-2-1.svg" width="960" class="wide-figure" /></p>
177176
<p>We generated these plots using our <a href="https://cmu-delphi.github.io/covidcast/covidcastR/">covidcast R
@@ -517,12 +516,13 @@ <h3>Correlations Sliced by County</h3>
517516
either that county had below 500 cumulative COVID-19 cases,
518517
or we didn’t have enough data from the surveys in
519518
order to estimate % CLI and % CLI-in-community signals there.</p>
520-
<pre class="r"><code># Set a bunch of fields so that the data frames know how to plot themselves
521-
df_cor1$time_value = df_cor2$time_value = start_day
522-
df_cor1$issue = df_cor2$issue = start_day
523-
attributes(df_cor1)$metadata$geo_type = &quot;county&quot;
524-
attributes(df_cor2)$metadata$geo_type = &quot;county&quot;
525-
class(df_cor1) = class(df_cor2) = c(&quot;covidcast_signal&quot;, &quot;data.frame&quot;)
519+
<pre class="r"><code># Use as.covidcast_signal to turn these into mappable signals
520+
df_cor1 = df_cor1 %&gt;%
521+
mutate(time_value = start_day) %&gt;%
522+
as.covidcast_signal(signal = &quot;cor1&quot;)
523+
df_cor2 = df_cor2 %&gt;%
524+
mutate(time_value = start_day) %&gt;%
525+
as.covidcast_signal(signal = &quot;cor1&quot;)
526526

527527
# Plot choropleth maps, using the covidcast plotting functionality
528528
p1 = plot(df_cor1, title = &quot;Correlation between % CLI and case rates&quot;,

content/blog/2020-10-14-dv-signal.Rmd

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ df_in = covidcast_signal("usa-facts", "confirmed_7dav_incidence_prop",
8989
df_dv_avg = df_dv %>% group_by(geo_value) %>% summarize(value = mean(value))
9090
df_in_avg = df_in %>% group_by(geo_value) %>% summarize(value = mean(value))
9191
92-
# Set a bunch of fields so that the data frames know how to plot themselves
93-
df_dv_avg$time_value = df_in_avg$time_value = start_day
94-
df_dv_avg$issue = df_in_avg$issue = start_day
95-
attributes(df_dv_avg)$metadata$geo_type = "state"
96-
attributes(df_in_avg)$metadata$geo_type = "state"
97-
class(df_dv_avg) = c("covidcast_signal", class(df_dv_avg))
98-
class(df_in_avg) = c("covidcast_signal", class(df_in_avg))
92+
# Use as.covidcast_signal to turn these into covidcast data frames
93+
df_dv_avg <- df_dv_avg %>%
94+
mutate(time_value = start_day) %>%
95+
as.covidcast_signal(signal = "dv_avg", geo_type = "state")
96+
df_in_avg <- df_in_avg %>%
97+
mutate(time_value = start_day) %>%
98+
as.covidcast_signal(signal = "in_avg", geo_type = "state")
9999
100100
# Plot choropleth maps, using the covidcast plotting functionality
101101
subtitle = paste("Averaged over", start_day, "to", end_day)
@@ -337,8 +337,12 @@ lm_dv_cases_df = dv_cases_df %>%
337337
ungroup()
338338
339339
df_cor_by_time_adj = covidcast_cor(
340-
dv_cases_df %>% mutate(value = dv*slope_6wk + int_6wk, issue = time_value),
341-
dv_cases_df %>% mutate(value = cases, issue = time_value),
340+
dv_cases_df %>%
341+
mutate(value = dv*slope_6wk + int_6wk, issue = time_value) %>%
342+
as.covidcast_signal(signal = "dv_cases"),
343+
dv_cases_df %>%
344+
mutate(value = cases, issue = time_value) %>%
345+
as.covidcast_signal(signal = "dv_cases"),
342346
by = "time_value",
343347
method = "spearman")
344348

content/blog/2020-10-14-dv-signal.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
summary: |
1818
In previous posts, we discussed our massive ongoing symptom surveys that have reached over 12 million people in the U.S. since April 2020, in partnership with Facebook and Google. Another one of our major data initiatives is based on partnerships with healthcare systems, granting us access to various aggregate statistics from hospital records and insurance claims covering 10-15% of the United States population. From these data, we can extract informative indicators that can be early indicators of COVID activity. This post focuses on one indicator in particular, based on outpatient visits, and demonstrates both the challenges and promises associated with medical records data.
1919
acknowledgements: |
20-
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21-
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
20+
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21+
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
2222
Roni Rosenfeld worked closely with our health systems partners to get access to the data and provided domain knowledge to ensure that the data was useful. Both Roni and Ryan Tibshirani provided helpful suggestions and insights towards the methodology and analysis.
2323

2424
output:
@@ -28,7 +28,6 @@
2828
toc: true
2929
---
3030

31-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
3231
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
3332
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
3433

@@ -88,13 +87,13 @@ <h2>The Doctor Visits Indicator</h2>
8887
df_dv_avg = df_dv %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
8988
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
9089

91-
# Set a bunch of fields so that the data frames know how to plot themselves
92-
df_dv_avg$time_value = df_in_avg$time_value = start_day
93-
df_dv_avg$issue = df_in_avg$issue = start_day
94-
attributes(df_dv_avg)$metadata$geo_type = &quot;state&quot;
95-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
96-
class(df_dv_avg) = c(&quot;covidcast_signal&quot;, class(df_dv_avg))
97-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
90+
# Use as.covidcast_signal to turn these into covidcast data frames
91+
df_dv_avg &lt;- df_dv_avg %&gt;%
92+
mutate(time_value = start_day) %&gt;%
93+
as.covidcast_signal(signal = &quot;dv_avg&quot;, geo_type = &quot;state&quot;)
94+
df_in_avg &lt;- df_in_avg %&gt;%
95+
mutate(time_value = start_day) %&gt;%
96+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
9897

9998
# Plot choropleth maps, using the covidcast plotting functionality
10099
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
@@ -317,8 +316,12 @@ <h2>Spatial Heterogeneity</h2>
317316
ungroup()
318317

319318
df_cor_by_time_adj = covidcast_cor(
320-
dv_cases_df %&gt;% mutate(value = dv*slope_6wk + int_6wk, issue = time_value),
321-
dv_cases_df %&gt;% mutate(value = cases, issue = time_value),
319+
dv_cases_df %&gt;%
320+
mutate(value = dv*slope_6wk + int_6wk, issue = time_value) %&gt;%
321+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322+
dv_cases_df %&gt;%
323+
mutate(value = cases, issue = time_value) %&gt;%
324+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322325
by = &quot;time_value&quot;,
323326
method = &quot;spearman&quot;)
324327

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: v1.12.4
3+
date: 2021-01-19
4+
---
5+
6+
This release improves the UX of the survey dashboard for both desktop and mobile experience.
7+
8+
#### New Features
9+
10+
- [#724](https://github.com/cmu-delphi/www-covidcast/pull/724), [#717](https://github.com/cmu-delphi/www-covidcast/pull/717) Survey dashboards improvements
11+
12+
#### Bug-fixes
13+
14+
- [#719](https://github.com/cmu-delphi/www-covidcast/pull/719) (re: [#718](https://github.com/cmu-delphi/www-covidcast/issues/718)) fix Export Data bug

devops/r.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# docker image for setting up an R environment
22
FROM continuumio/miniconda
33

4+
RUN conda install --name base --channel conda-forge mamba=*
5+
46
ADD ./environment.yml .
5-
RUN conda env create -f environment.yml
7+
RUN mamba env create -f environment.yml
68

79
ADD ./dependencies.R .
810

environment.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- gdal=3.0.2
7-
- python=3.7.9
8-
- pip=20.2.4
6+
- gdal
7+
- python=3.9.1
8+
- pip
99
- r-base=3.6.3
1010
- glib
1111
- mscorefonts
@@ -32,7 +32,8 @@ dependencies:
3232
- r-isoband
3333
- r-ggrepel
3434
- r-plotly
35-
- r-usmap
35+
- r-sf
36+
- r-lubridate
3637
- pandoc
3738
- fiona
3839
- geopandas
@@ -41,5 +42,6 @@ dependencies:
4142
- pillow
4243
- pyproj
4344
- matplotlib
45+
- udunits2
4446
- pip:
45-
- covidcast==0.1.2
47+
- covidcast==0.1.3

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "www-main",
3-
"version": "1.12.3",
3+
"version": "1.12.4",
44
"private": true,
55
"dependencies": {
66
"@fortawesome/fontawesome-free": "^5.15.1",
77
"highlight.js": "^10.5.0",
88
"katex": "^0.12.0",
99
"uikit": "^3.6.5",
10-
"www-covidcast": "https://github.com/cmu-delphi/www-covidcast/releases/download/v1.12.3/www-covidcast-1.12.3.tgz"
10+
"www-covidcast": "https://github.com/cmu-delphi/www-covidcast/releases/download/v1.12.4/www-covidcast-1.12.4.tgz"
1111
},
1212
"devDependencies": {
1313
"hugo-bin": "^0.67.1",

0 commit comments

Comments
 (0)