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:
tinytex::install_tinytex()
pandoc-citeproc
too# 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")
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())
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.