Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blog build #891

Merged
merged 26 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8eaf48d
add instruction to build blog locally with personal api key
minhkhul Nov 10, 2023
ad85648
fix quidel #887 by removing r chunk result + warn readers
minhkhul Nov 10, 2023
197a505
upgrade python covidcast version + add api key to python chunk in blog
minhkhul Nov 10, 2023
1c9b847
api key add on
minhkhul Nov 10, 2023
d21f9a9
generated files
minhkhul Nov 10, 2023
9f29096
Revert "generated files"
minhkhul Nov 16, 2023
5198217
Update content/blog/2020-08-28-api.Rmd
minhkhul Nov 16, 2023
367e3f7
Update content/blog/2020-08-28-api.Rmd
minhkhul Nov 16, 2023
9a77f66
Update content/blog/2020-08-28-api.Rmd
minhkhul Nov 16, 2023
2875e9f
Update content/blog/2020-10-06-survey-wave-4.Rmd
minhkhul Nov 16, 2023
e7bec51
Update content/blog/2020-12-10-masks-public.Rmd
minhkhul Nov 16, 2023
3c8b2d6
Update content/blog/2021-01-22-holiday-surveys.Rmd
minhkhul Nov 16, 2023
ace2791
Update content/blog/_2021-04-20-jj-vaccine.Rmd
minhkhul Nov 16, 2023
8e53525
generated files (only ones with code changes)
minhkhul Nov 16, 2023
059a499
Revert "generated files (only ones with code changes)"
minhkhul Nov 20, 2023
887e338
add api keys visibility + instruction link
minhkhul Nov 20, 2023
302ce60
more api key visibility + instruction link
minhkhul Nov 20, 2023
17a1150
generated html for files with code changes
minhkhul Nov 20, 2023
57c77f3
Revert "generated html for files with code changes"
minhkhul Nov 22, 2023
665df51
every R chunk that import library(covidcast) will have an associated …
minhkhul Nov 22, 2023
fe5e6ff
fix visuals not showing up due to warning messages
minhkhul Nov 22, 2023
9bf703d
workaround render python chunk plot
minhkhul Nov 27, 2023
bd88c4b
generated files from rmd with changes
minhkhul Nov 27, 2023
529d4d8
remove warning in blog 2021-01-15-causal-effect-mobility
minhkhul Dec 5, 2023
4da2286
clean up plot fix
minhkhul Dec 5, 2023
bd7ec32
remove warning 2020-12-10-masks-public
minhkhul Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ As an alternative you can use Docker and Docker Compose:
1. `docker-compose up -d` to create a docker container for the current environment.
1. `docker-compose exec r bash` to jump into the container.
1. `micromamba activate www-main` to activate the environment
2. `export API_KEY=y0urAp1kEy` to add your own api key as env variable.

Now you have the environment ready to start converting .Rmd blog files to html.
#### Commands
Expand Down
39 changes: 19 additions & 20 deletions content/blog/2015-07-23-template-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,22 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#including-plots">Including Plots</a>
<li><a href="#including-plots" id="toc-including-plots">Including Plots</a>
<ul>
<li><a href="#wide-figure">Wide Figure</a></li>
<li><a href="#wide-figure" id="toc-wide-figure">Wide Figure</a></li>
</ul></li>
<li><a href="#including-math">Including Math</a></li>
<li><a href="#metadata">Metadata</a>
<li><a href="#including-math" id="toc-including-math">Including Math</a></li>
<li><a href="#metadata" id="toc-metadata">Metadata</a>
<ul>
<li><a href="#tags">Tags</a></li>
<li><a href="#tags" id="toc-tags">Tags</a></li>
</ul></li>
<li><a href="#linking">Linking</a>
<li><a href="#linking" id="toc-linking">Linking</a>
<ul>
<li><a href="#linking-to-other-pages-and-blog-posts">Linking to other pages and blog posts:</a></li>
<li><a href="#linking-to-the-api-doc">Linking to the API doc:</a></li>
<li><a href="#linking-to-other-pages-and-blog-posts" id="toc-linking-to-other-pages-and-blog-posts">Linking to other pages and blog posts:</a></li>
<li><a href="#linking-to-the-api-doc" id="toc-linking-to-the-api-doc">Linking to the API doc:</a></li>
</ul></li>
</ul>
</div>
Expand All @@ -48,21 +47,21 @@
see <a href="http://rmarkdown.rstudio.com" class="uri">http://rmarkdown.rstudio.com</a>.</p>
<p>You can embed an R code chunk like this:</p>
<pre class="r"><code>summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
fit &lt;- lm(dist ~ speed, data = cars)
fit
##
##
## Call:
## lm(formula = dist ~ speed, data = cars)
##
##
## Coefficients:
## (Intercept) speed
## (Intercept) speed
## -17.579 3.932</code></pre>
<div id="including-plots" class="section level2">
<h2>Including Plots</h2>
Expand All @@ -74,7 +73,7 @@ <h2>Including Plots</h2>
col = c(&#39;#0292D8&#39;, &#39;#F7EA39&#39;, &#39;#C4B632&#39;),
init.angle = -50, border = NA
)</code></pre>
<div class="figure"><span id="fig:pie"></span>
<div class="figure"><span style="display:block;" id="fig:pie"></span>
<img src="/blog/2015-07-23-template-post_files/figure-html/pie-1.svg" alt="A fancy pie chart." width="672" />
<p class="caption">
Figure 1: A fancy pie chart.
Expand All @@ -94,7 +93,7 @@ <h3>Wide Figure</h3>
col = c(&#39;#0292D8&#39;, &#39;#F7EA39&#39;, &#39;#C4B632&#39;),
init.angle = -50, border = NA
)</code></pre>
<div class="figure"><span id="fig:wide-pie"></span>
<div class="figure"><span style="display:block;" id="fig:wide-pie"></span>
<img src="/blog/2015-07-23-template-post_files/figure-html/wide-pie-1.svg" alt="A fancy pie chart." width="672" class="wide-figure" />
<p class="caption">
Figure 2: A fancy pie chart.
Expand Down
7 changes: 3 additions & 4 deletions content/blog/2020-08-10-hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#a-little-bit-about-us">A Little Bit About Us</a></li>
<li><a href="#our-mission-and-strategy">Our Mission and Strategy</a></li>
<li><a href="#what-weve-been-up-to">What We’ve Been Up To</a></li>
<li><a href="#a-little-bit-about-us" id="toc-a-little-bit-about-us">A Little Bit About Us</a></li>
<li><a href="#our-mission-and-strategy" id="toc-our-mission-and-strategy">Our Mission and Strategy</a></li>
<li><a href="#what-weve-been-up-to" id="toc-what-weve-been-up-to">What We’ve Been Up To</a></li>
</ul>
</div>

Expand Down
3 changes: 2 additions & 1 deletion content/blog/2020-08-26-fb-survey.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ output:
toc: true
---

```{r, echo=FALSE}
```{r, include = FALSE}
minhkhul marked this conversation as resolved.
Show resolved Hide resolved
library(covidcast)
options(covidcast.auth = Sys.getenv("API_KEY"))
```

Expand Down
31 changes: 15 additions & 16 deletions content/blog/2020-08-26-fb-survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#short-background">Short Background</a></li>
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
<li><a href="#short-background" id="toc-short-background">Short Background</a></li>
<li><a href="#why-run-these-surveys" id="toc-why-run-these-surveys">Why Run These Surveys?</a></li>
<li><a href="#whats-in-the-survey" id="toc-whats-in-the-survey">What’s in the Survey?</a></li>
<li><a href="#some-interesting-examples" id="toc-some-interesting-examples">Some Interesting Examples</a></li>
<li><a href="#basic-correlation-analysis" id="toc-basic-correlation-analysis">Basic Correlation Analysis</a>
<ul>
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
<li><a href="#correlations-sliced-by-time" id="toc-correlations-sliced-by-time">Correlations Sliced by Time</a></li>
<li><a href="#correlations-sliced-by-county" id="toc-correlations-sliced-by-county">Correlations Sliced by County</a></li>
</ul></li>
<li><a href="#whats-next-with-the-surveys">What’s Next with the Surveys</a></li>
<li><a href="#whats-next-with-the-surveys" id="toc-whats-next-with-the-surveys">What’s Next with the Surveys</a></li>
</ul>
</div>

Expand Down Expand Up @@ -172,7 +171,7 @@ <h2>Short Background</h2>
title = &quot;Daily new confirmed COVID-19 cases per 100,000 people&quot;,
range = c(0, 30), choro_params = list(subtitle = subtitle))
grid.arrange(p1, p2, nrow = 1)</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-2-1.svg" width="960" class="wide-figure" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-3-1.svg" width="960" class="wide-figure" /></p>
<p>We generated these plots using our <a href="https://cmu-delphi.github.io/covidcast/covidcastR/">covidcast R
package</a>.
In all, fetching the data from our API and producing the heatmaps
Expand Down Expand Up @@ -353,7 +352,7 @@ <h2>Some Interesting Examples</h2>
linetype = 2, size = 1, color = ggplot_colors[1]) +
geom_vline(xintercept = as.numeric(as.Date(&quot;2020-06-25&quot;)),
linetype = 2, size = 1, color = ggplot_colors[2])</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-3-1.svg" width="576" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-4-1.svg" width="576" /></p>
<p>This example, as with all code examples in this blog post, was produced using
our <a href="https://cmu-delphi.github.io/covidcast/covidcastR/">covidcast R package</a>.</p>
<p>A first glance reveals that the % CLI-in-community indicator
Expand Down Expand Up @@ -381,7 +380,7 @@ <h2>Some Interesting Examples</h2>
p_list[[i]] = plot_one(geo_values[i], legend = FALSE)
}
do.call(grid.arrange, c(p_list, nrow = 5, ncol = 4))</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-4-1.svg" width="960" class="wide-figure" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-5-1.svg" width="960" class="wide-figure" /></p>
<p>The examples above are an informal way of looking
at the <em>recall</em> of the % CLI-in-community signal.
Of course, this is only one half of the story:
Expand Down Expand Up @@ -451,7 +450,7 @@ <h3>Correlations Sliced by Time</h3>
subtitle = sprintf(&quot;Over all counties with at least %i cumulative cases&quot;,
case_num), x = &quot;Date&quot;, y = &quot;Correlation&quot;) +
theme_bw() + theme(legend.pos = &quot;bottom&quot;, legend.title = element_blank())</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-5-1.svg" width="576" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-6-1.svg" width="576" /></p>
<p>Another interesting observation is that the correlations from either indicator
increase dramatically sometime around mid-June.
This could be because many counties saw big surges in COVID-19 activity around
Expand All @@ -473,7 +472,7 @@ <h3>Correlations Sliced by Time</h3>
subtitle = sprintf(&quot;Over all counties with at least %i cumulative cases&quot;,
case_num), x = &quot;Date&quot;, y = &quot;Median abs deviation&quot;) +
theme_bw()</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-6-1.svg" width="576" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-7-1.svg" width="576" /></p>
</div>
<div id="correlations-sliced-by-county" class="section level3">
<h3>Correlations Sliced by County</h3>
Expand Down Expand Up @@ -501,7 +500,7 @@ <h3>Correlations Sliced by County</h3>
subtitle = sprintf(&quot;Over all counties with at least %i cumulative cases&quot;,
case_num), x = &quot;Correlation&quot;, y = &quot;Density&quot;) +
theme_bw() + theme(legend.pos = &quot;bottom&quot;, legend.title = element_blank())</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-7-1.svg" width="576" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-8-1.svg" width="576" /></p>
<p>We can also examine choropleth maps of these correlations to learn
where (geographically speaking) they’re high and where they’re not.
As we can see from the maps below, the % CLI-in-community indicator
Expand All @@ -525,7 +524,7 @@ <h3>Correlations Sliced by County</h3>
p2 = plot(df_cor2, title = &quot;Correlation between % CLI-in-community and case rates&quot;,
range = c(-1, 1), choro_col = cm.colors(10))
grid.arrange(p1, p2, nrow = 1)</code></pre>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-8-1.svg" width="960" class="wide-figure" /></p>
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-9-1.svg" width="960" class="wide-figure" /></p>
</div>
</div>
<div id="whats-next-with-the-surveys" class="section level2">
Expand Down
8 changes: 7 additions & 1 deletion content/blog/2020-08-28-api.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ and ask "What was known _as of_ this date?"
This is important because estimates
can change for _weeks_ as new data arrives:

```{r q-versioning, warning=FALSE, message=FALSE, cache=TRUE}
```{r q-versioning, warning=FALSE, message=FALSE, cache=TRUE, eval = FALSE}
minhkhul marked this conversation as resolved.
Show resolved Hide resolved
library(covidcast)
library(dplyr)
query_date <- "2020-08-01"
Expand All @@ -300,6 +300,7 @@ covidcast_signal(
col.names = c("Test date", "Positivity rate (%)", "Sample size",
"Issued on", "Lag (days)"))
```
*Nov 6 2023 update: Quidel covidtest data is no longer available for public viewing, so we have removed the result of this code chunk.*
minhkhul marked this conversation as resolved.
Show resolved Hide resolved

Many data sources are subject to revisions:

Expand Down Expand Up @@ -397,6 +398,11 @@ According to the `r blogdown::shortcode_html("apireflink", "api/covidcast-signal
this is the `fb-survey` data source's `smoothed_hh_cmnty_cli` signal.
(Click the "Code" button to see the Python code used to produce this example.)

```{python, include = FALSE}
minhkhul marked this conversation as resolved.
Show resolved Hide resolved
import covidcast
import os
covidcast.use_api_key(os.environ['API_KEY'])
```
```{python python-data, dev='svg'}
import covidcast
from datetime import date
Expand Down
Loading