Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonardo Collado-Torres lcolladotor

View GitHub Profile
@lcolladotor
lcolladotor / outliers.Rmd
Created Aug 28, 2013
Rmd file for generating http://rpubs.com/lcollado/7901 The main issue is that only the last DataTable will show in the html.
View outliers.Rmd
Remove outliers
===============
The goal is to remove outliers (by variable) by marking them as NA and keeping a record of which were outliers.
# Data
First, lets create a sample data set
```{r data}
@lcolladotor
lcolladotor / .Rprofile
Created Aug 30, 2013
.Rprofile to run knitrBootstrap
View .Rprofile
## For knitr bootstrap
## More info at http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
require(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, code_style="Brown Paper", chooser=c("boot", "code"), show_code=FALSE)
}
)
@lcolladotor
lcolladotor / outlier.Rmd
Created Aug 30, 2013
Updated outliers.Rmd with rawData instead of data and linking to the GitHub issue that solved the multi-table issue.
View outlier.Rmd
Remove outliers
===============
The goal is to remove outliers (by variable) by marking them as NA and keeping a record of which were outliers.
# Data
First, lets create a sample data set
```{r data}
@lcolladotor
lcolladotor / .Rprofile
Last active Dec 22, 2015
outliers.Rmd final version and .Rprofile for running knitrBootstrap in RStudio Edit: Added knitr::render_html() in the Rmd file and took it off from .Rprofile after re-reading https://github.com/jimhester/knitrBootstrap/issues/20
View .Rprofile
## For knitr bootstrap
## More info at http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
library(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, code_style="Brown Paper", chooser=c("boot", "code"), show_code=FALSE)
}
)
@lcolladotor
lcolladotor / .Rprofile
Created Sep 5, 2013
Basic example of using knitrBootstrap in RStudio
View .Rprofile
## For knitr bootstrap
## More info at http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
library(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, code_style="Brown Paper", chooser=c("boot", "code"), show_code=FALSE)
}
)
@lcolladotor
lcolladotor / .Rprofile
Last active Dec 23, 2015
Example on how to fix dTable() when Inf and -Inf values are present. Includes .Rprofile for using knitrBootstrap via RStudio
View .Rprofile
## For knitr bootstrap
## More info at http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
library(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, code_style="Brown Paper", chooser=c("boot", "code"), show_code=FALSE)
}
)
View longRle.Rmd
Quantiles from Rle's with long lengths
======================================
```{r echo=FALSE}
library(knitr)
render_html()
```
The goal is to calculate quantiles on aggregated long Rle's. The information is split by chr, and combining it naively fails.
@lcolladotor
lcolladotor / 2013-mm-dd-template.Rmd
Created Nov 9, 2013
Post template for bit.ly/FellBit
View 2013-mm-dd-template.Rmd
---
layout: post
title: CHANGEME
tags:
- CHANGEME
categories:
- CHANGEME
---
{% include JB/setup %}
@lcolladotor
lcolladotor / knit-to-post
Created Nov 9, 2013
Textmate command for creating Jekyll-Bootstrap posts via Knitr
View knit-to-post
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
# Source some support functions we need.
. "${TM_SUPPORT_PATH}/lib/html.sh"
. "${TM_SUPPORT_PATH}/lib/webpreview.sh"
# Get the viewer program. Any program (that works with open -a <name>) can be used,
# except 'html' which is reserved to mean the internal HTML window. This is also the
# default option.
View how-it-should-look-like
{% highlight r %}
## CHUNK
{% endhighlight %}