Skip to content

Instantly share code, notes, and snippets.

@daroczig
Created April 14, 2014 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daroczig/10681547 to your computer and use it in GitHub Desktop.
Save daroczig/10681547 to your computer and use it in GitHub Desktop.
Demo statistical report template for "Creating statistical reports in the past, present and future"

A "rapport" template published in Gergely Daróczi (2014): "Creating statistical reports in the past, present and future". Romanian Statistical Review. (?)?: ?-?

<!--head
meta:
author: Gergely Daróczi
title: Rapport demo
description: This is POC demo on the usage of rapport templates
packages:
- ggplot2
- pander
inputs:
- name: v
label: Variable to analyse
description: A numeric variable from the passed dataset.
required: yes
class: numeric
standalone: no
length:
min: 1.0
max: 1.0
- name: color
label: Color of the histogram
description: The name or hexa code of a color.
standalone: yes
value: red
class: character
head-->
# A quick analyis on <%= v.name %>
The mean of <%= v.name %> is <%= mean(v) %> and the standard
deviation is <%= sd(v) %>. Let us also check the
frequency table:
<%= table(v) %>
## Tables are boring!
<%=
set.caption(paste('Histogram of', v.name))
hist(v, xlab = v, col = color, main = '')
%>
> library(rapport)
> rapport('demo.rapport', data = mtcars, v = 'am')
# A quick analyis on am
The mean of am is _0.4062_ and the standard
deviation is _0.499_. Let us also check the
frequency table:
-------
0 1
--- ---
19 13
-------
## Tables are boring!
![Histogram of am](plots/rapport-demo-rapport-3-1.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment