Template Post

#R Markdown #plot #regression

Frida Gomam

Outline

    Each blog post is an R Markdown document. For more details on using R Markdown see http://rmarkdown.rstudio.com.

    You can embed an R code chunk like this:

    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
    ##  Max.   :25.0   Max.   :120.00
    fit <- lm(dist ~ speed, data = cars)
    fit
    ##
    ## Call:
    ## lm(formula = dist ~ speed, data = cars)
    ##
    ## Coefficients:
    ## (Intercept)        speed
    ##     -17.579        3.932

    Including Plots

    You can also embed plots. See Figure 1 for example:

    par(mar = c(0, 1, 0, 1))
    pie(
      c(280, 60, 20),
      c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'),
      col = c('#0292D8', '#F7EA39', '#C4B632'),
      init.angle = -50, border = NA
    )
    A fancy pie chart.

    Figure 1: A fancy pie chart.

    For posts where we’re using our public data and showing it off, including some of the code chunks would be great so that readers see how easy it is to use our data. But for other audiences, it’s probably best to use the echo=FALSE chunk option so the code is not included in the post.

    Wide Figure

    To create a wide figure, add the out.extra='class="wide-figure"' markup:

    par(mar = c(0, 1, 0, 1))
    pie(
      c(280, 60, 20),
      c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'),
      col = c('#0292D8', '#F7EA39', '#C4B632'),
      init.angle = -50, border = NA
    )
    A fancy pie chart.

    Figure 2: A fancy pie chart.

    Including Math

    You can embed mathematics by using dollar signs for inline math and double dollars for display math: \(x = \sum_{i=1}^n i\),

    \[ \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

    Metadata

    Each post has a title, author, date, and tags. Choose bold, active titles, like “Delphi releases new survey data”, rather than boring titles like “New survey aggregates”.

    The author metadata should credit the post author or authors; But in the post acknowledgements, you should also generously name anyone who helped with parts of your post, e.g., the team members who obtained data or set up a server or developed a package you use.

    Tags

    Each post can be tagged, as you can see in the metadata block at the top. I suggest we consider the following tags as base tags:

    • forecasting
    • nowcasting
    • symptom surveys
    • medical records
    • COVIDcast API
    • COVIDcast map
    • data sources (for everthing else than symptom surveys and medical records)
    • news (for announcements of new features, new models, etc.)
    • R (for posts containing R, typically, our covidcast R package)
    • Python (for posts containing Python, typically, our covicast Python package)

    Linking

    Linking to other pages and blog posts:

    using the file name and the Hugo shortcodes, e.g.: Facebook Post. Jumping to a specific section/anchor is supported too: previous exploratory investigations

    Linking to the API doc:

    there is another shortcode for creating an api link, e.g. public API or Doctor's Visits signal

    Acknowledgements: List acknowledgements here

    Related Posts:

    Frida Gomam is a member of the Delphi group and a Ph.D. student in data wrangling at the University of Southern North Dakota at Hoople.
    © 2024 Delphi group authors. Text and figures released under CC BY 4.0 ; code under the MIT license.

    Latest Stories