Placeholder for supplementary resources for the above BMS article.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> library(pander) | |
> str(Pandoc.brew(text='Pi equals to <%=pi%>.\nAnd here are some random data:\n<%=runif(10)%>')) | |
Pi equals to _3.142_. | |
And here are some random data: | |
_0.9281_, _0.7048_, _0.5285_, _0.469_, _0.4796_, _0.844_, _0.2564_, _0.8511_, _0.5924_ and _0.8484_ | |
List of 3 | |
$ :List of 4 | |
..$ type : chr "text" | |
..$ text :List of 2 | |
.. ..$ raw : chr "Pi equals to <%=pi%>.\nAnd here are some random data:\n" |
A "rapport" template published in Gergely Daróczi (2014): "Creating statistical reports in the past, present and future". Romanian Statistical Review. (?)?: ?-?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> dim(m) | |
[1] 32400 32400 | |
> sum(m) / prod(dim(m)) | |
[1] 0.0007337982 | |
> table(rowSums(m)) | |
0 16 22 26 35 38 41 46 | |
15549 96 30 29 28 27 26 16615 | |
> table(colSums(m)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(pander) | |
evals(readLines('demo.R')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Start with the official rocker image (lightweight Debian) | |
FROM rocker/r-base:latest | |
MAINTAINER Gergely Daroczi <[email protected]> | |
## Install Java | |
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \ | |
| tee /etc/apt/sources.list.d/webupd8team-java.list \ | |
&& echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \ | |
| tee -a /etc/apt/sources.list.d/webupd8team-java.list \ |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(rmarkdown) | |
shinyServer(function(input, output) { | |
output$html = reactive({ | |
t <- tempfile() | |
cat(input$markdown, file = t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Connect and query Imapala via SSH and Impala-shell | |
#' @param query SQL query to run | |
#' @param host server hostname or IP | |
#' @param log enable or disable logging of debug/trace messages | |
#' @return data.table object | |
#' @export | |
query_impala <- function(query, host = 'localhost', log = require(futile.logger)) { | |
## measure time of query | |
timer <- proc.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(XML) | |
html <- htmlParse(readLines('https://www.meetup.com/topics/r-project-for-statistical-computing/all/')) | |
names <- xpathSApply(html, '//li[@class="gridList-item"]/a/span', xmlValue) | |
attrs <- xpathSApply(html, '//li[@class="gridList-item"]/span[@class="text--secondary text--small chunk"]', xmlValue) | |
attrs <- gsub('\\n|\\t', '', attrs) | |
users <- as.numeric(gsub(',', '', sub('^([0-9,]*) .*', '\\1', attrs))) | |
geo <- sub('.* \\| ', '', attrs) | |
data.frame(name = names, location, members) |