Skip to content

Instantly share code, notes, and snippets.

Jeromy Anglim jeromyanglim

Block or report user

Report or block jeromyanglim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeromyanglim
jeromyanglim / bibmash
Created Jun 10, 2012
script for extracting apa; I might write a post at some point about how it all works. it's mainly a personal script; it's very raw; use at own risk
View bibmash
#!/bin/bash
bibtexstylefile=apalike
bibtexdatabase=$BIB
pdfdirectory=$BIBDIR
pdfprogram=evince
pandocoutputformat=plain
# returntask
# bibtex : return bibtex record (default)
# format : return
View rpubs-test.rmd
This document is just a test of RPubs platform for publishing R Markdown. I'll use the `survey` dataset from the `MASS` package to explore a few features.
```{r get_data, message=FALSE}
library(MASS)
library(psych)
library(Hmisc)
library(xtable)
data(survey)
```
@jeromyanglim
jeromyanglim / loopsrmarkdown.html
Created May 22, 2012
example of loops and plots in R Markdown
View loopsrmarkdown.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<base target="_blank"/>
@jeromyanglim
jeromyanglim / r-markdown-example.html
Created May 21, 2012
file produced by R Markdown example
View r-markdown-example.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
View caschools-analysis.rmd
`r opts_chunk$set(cache=TRUE)`
This is a quick set of analyses of the California Test Score dataset. The post was produced using R Markdown in RStudio 0.96. The main purpose of this post is to provide a case study of using R Markdown to prepare a quick reproducible report. It provides examples of using plots, output, in-line R code, and markdown. The post is designed to be read along side the R Markdown source code, which is available as a gist on github.
<!-- more -->
### Preliminaries
* This post builds on my earlier post which provided a guide for [Getting Started with R Markdown, knitr, and RStudio 0.96](jeromyanglim.blogspot.com/2012/05/getting-started-with-r-markdown-knitr.html)
* The dataset analysed comes from the `AER` package which is an accompaniment to the book [Applied Econometrics with R](http://www.amazon.com/Applied-Econometrics-R-Use/dp/0387773169) written by [Christian Kleiber](http://wwz.unibas.ch/personen/profil/person/kleiber/) and [Achim Zeileis](http://eeecon.uibk.ac.at/~zeileis/
@jeromyanglim
jeromyanglim / example-r-markdown.rmd
Created May 17, 2012
Example of using R Markdown
View example-r-markdown.rmd
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown)
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96.
This combination of tools provides an exciting improvement in usability for
[reproducible analysis](http://stats.stackexchange.com/a/15006/183).
Specifically, this post
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96;
(2) provides a basic example of producing console output and plots using R Markdown;
(3) highlights several code chunk options such as caching and controlling how input and output is displayed;
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and
(5) discusses the implications of R Markdown.
View mathjax-addition
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/javascript">MathJax.Hub.Config({tex2jax: {processEscapes: true,
processEnvironments: false, inlineMath: [ ['$','$'] ],
displayMath: [ ['$$','$$'] ] },
asciimath2jax: {delimiters: [ ['$','$'] ] },
"HTML-CSS": {minScaleAdjust: 125 } });
</script>
@jeromyanglim
jeromyanglim / abilitytests.exp
Created May 11, 2012
Simple, 2-choice, and 4-choice reaction time experiment using Inquisit
View abilitytests.exp
<expt ability>
/preinstructions = (initial.instructions)
/blocks=[1=pm.simple; 2=pm.4choice; 3=ac.test.type]
</expt>
<data>
/columns=[date, time, build, subject, trialcode, blockcode, blocknum, trialnum, latency, response, pretrialpause,
posttrialpause, trialtimeout, blocktimeout, correct, stimulusitem, stimulusnumber,
display.height, display.width,
computer.cpuspeed, computer.os,
@jeromyanglim
jeromyanglim / 3catggplot2.r
Created May 3, 2012
plot with three categorical variables and one continuous variable using ggplot2
View 3catggplot2.r
#http://jeromyanglim.blogspot.com.au/2012/05/how-to-plot-three-categorical-variables.html
library(ggplot2)
# Create some data
set.seed(4444)
Data <- expand.grid(group=c("Apples", "Bananas", "Carrots", "Durians", "Eggplants"),
year=c("2000", "2001", "2002"),
quality=c("Grade A", "Grade B", "Grade C", "Grade D", "Grade E"))
Group.Weight <- data.frame(
group=c("Apples", "Bananas", "Carrots", "Durians", "Eggplants"),
View data.txt
6162.178176 0.049820046
4675.14432 0.145022261
5969.056896 0.47210138
5357.506176 0.052263122
33.796224 16.45154204
6162.178176 0.064262991
6725.448576 0.419005508
3247.656192 0.867394771
5357.506176 0.052263122
3612.97728 0.091337414
You can’t perform that action at this time.