# loading libraries
library(png)
library(knitr)
library(grid)
library(ggplot2)
# options
opts_chunk$set(cache = TRUE, echo = FALSE)
opts_chunk$set(cache.path = '/tmp/')
# auxiliary function
plot.png <- function(filename) {
  img <- readPNG(paste0(filename, '.png'))
  g <- rasterGrob(img, interpolate = TRUE)
  qplot(dim(img)[1] / 2, dim(img)[2] / 2) + 
    xlim(c(1, dim(img)[1])) + ylim(c(1, dim(img)[2])) +
    geom_point() +
    annotation_custom(g, xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf) +
    theme_void()
}

Purpose

In my experience, statistical model code always consists of pretty much the same:

With this package, I am attempting to establish a few patterns in my code, so that it becomes easier to read, debug, and modify. I have created the following virtual reference classes:

plot.png('basic')
plot.png('daemon')
plot.png('strategy')
plot.png('parameters')
plot.png('factory')
plot.png('plotter')
plot.png('ggplotter')
plot.png('random')

Here is how these classes connect.

plot.png('classes')


rtlemos/rcvirtual documentation built on May 28, 2019, 9:56 a.m.