Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

An R Markdown report template based on {memor} template, for use by Wikimedia Foundation's Product Analytics team

License

Notifications You must be signed in to change notification settings

bearloga/wmf-product-analytics-report

Repository files navigation

WMF Product Analytics Reporting Template

A report template, based on memor template, for use by the Product Analytics team within Wikimedia Audiences department.

Note: this report template uses R Markdown, which supports Python, meaning data analysis does not have to be done in R. In addition to that, data can fetched with SQL from a database and then transferred between R and Python chunks. For example, see python.Rmd and python.pdf:

Pages 1 and 2 of an example report which uses Python and R Pages 3 and 4 of an example report which uses Python and R

Prerequisites

  • Fonts
  • Pandoc
    • bundled with RStudio
    • if installing separately (i.e. via Homebrew), install pandoc-citeproc too

Installation

# install.packages("remotes")
remotes::install_github("bearloga/wmf-product-analytics-report")

Although I recommend using this command instead:

remotes::install_github("bearloga/wmf-product-analytics-report", dependencies = "Suggests")

Usage

If using the RStudio IDE (recommended), use File → New File → R Markdown and select "Product Analytics Report" in the From Template panel, or use the following specification in the front-matter YAML of an existing R Markdown document:

output: wmfpar::pdf_report
nocite: "@*"

Then, either use the Knit feature in the RStudio IDE (recommended) or run the following in R:

rmarkdown::render("input.Rmd", wmfpar::pdf_report())

Bibliography

By default, the template cites the following necessary R packages: base, rmarkdown, knitr, memor, and wmfpar (itself). The cite_r_packages option is used to add packages to the list. For example:

output:
  wmfpar::pdf_report:
    cite_r_packages:
      - kableExtra
      - ggplot2
nocite: "@*"

If you have additional .bib files you wish to include, use the extra_bibs option. For example, if you had a dl.bib file with BibTeX entries for TensorFlow and books & articles related to deep learning and you used the R interface to TF, you would use the following:

output:
  wmfpar::pdf_report:
    cite_r_packages:
      - tensorflow
      - keras
    extra_bibs:
      - dl.bib
nocite: "@*"

Note: I still need to figure out how to include nocite by default without having to specify it in the front-matter YAML. (Issue #1)

About

An R Markdown report template based on {memor} template, for use by Wikimedia Foundation's Product Analytics team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published