A Pen by Ramnath Vaidyanathan on CodePen.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<script src="data:application/x-javascript,%28function%28%29%20%7B%0A%20%20%2F%2F%20If%20window%2EHTMLWidgets%20is%20already%20defined%2C%20then%20use%20it%3B%20otherwise%20create%20a%0A%20%20%2F%2F%20new%20object%2E%20This%20allows%20preceding%20code%20to%20set%20options%20that%20affect%20the%0A%20%20%2F%2F%20initialization%20process%20%28though%20none%20currently%20exist%29%2E%0A%20%20window%2EHTMLWidgets%20%3D%20window%2EHTMLWidgets%20%7C%7C%20%7B%7D%3B%0A%20%20%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20a%20viewer%20pane%2E%20If%20not%2C%20we%27re%20in%20a%20web%20browser%2E%0A%20%20var%20viewerMode%20%3D%20window%2EHTMLWidgets%2EviewerMode%20%3D%0A%20%20%20%20%20%20%2F%5Cbviewer%5Fpane%3D1%5Cb%2F%2Etest%28window%2Elocation%29%3B%0A%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20Shiny%20mode%2E%20If%20not%2C%20it%27s%20a%20static%20document%2E%0A%20%20%2F%2F%20Note%20that%20static%20widgets%20can%20appear%20in%20both%20Shiny%20and%20st |
This file contains 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
#' Group Mean | |
#' | |
#' @examples | |
#' iris %>% | |
#' group_mean(Species, Petal.Length) | |
group_mean <- function(tbl, group_var, summary_var){ | |
tbl %>% | |
group_by({{ group_var }}) %>% | |
summarize( | |
{{ summary_var }} := mean({{ summary_var }}) |
This file contains 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
--- | |
title : Two Column Layout | |
author : Ramnath Vaidyanathan | |
framework : io2012 # {io2012, html5slides, shower, dzslides, ...} | |
highlighter : highlight.js # {highlight.js, prettify, highlight} | |
hitheme : solarized_light # | |
--- .RAW | |
## Two Column Layout |
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
This is a short demo of how to use brew
and knitr
in combination with each other to get the best of the templating facilities in brew
and the literate programming functions in knitr
. The main idea is to write a function brew_knit
# Preprocess template using brew and then run knit on the output
brew_knit <- function(template, params, ...){
brew::brew(template, envir = list2env(params))
input = gsub(".Rnwe", '.Rnw', template)
knitr::knit(input)
}
This file contains 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
# fix required for R versions earlier than 3.1.2 | |
if (R.Version()$minor < "1.2") { | |
source("ggplot_fix.R") | |
} | |
## Hypothesis Testing and A/B Tests | |
n <- 10^4 | |
p1 <- 0.05 | |
p2 <- p1 + 0.005 | |
alpha <- 0.05 | |
sd <- sqrt(p1*(1 - p1)/n) |
This gist consists of a makefile
and a script
that can automate the creation of PDFs from Slidify generated HTML slides. The script assumes that the makefile
and the script makepdf.js
are in the same directory as the Rmd
file. The makepdf.js
script uses casperjs, a very useful utility to automate tasks that require browser interaction. You may follow the installation instructions on the casperjs website, to make sure that you have all the dependencies correctly installed before trying this out.
This file contains 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
#!/bin/sh | |
####################################################### | |
# UNIX TREE # | |
# Version: 2.3 # | |
# File: ~/apps/tree/tree.sh # | |
# # | |
# Displays Structure of Directory Hierarchy # | |
# ------------------------------------------------- # | |
# This tiny script uses "ls", "grep", and "sed" # | |
# in a single command to show the nesting of # |