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 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"/> |
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
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) | |
``` |
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/bash | |
bibtexstylefile=apalike | |
bibtexdatabase=$BIB | |
pdfdirectory=$BIBDIR | |
pdfprogram=evince | |
pandocoutputformat=plain | |
# returntask | |
# bibtex : return bibtex record (default) | |
# format : return |
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
* asdf | |
```{r} | |
'asdf' | |
``` |
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
kbd{white-space:nowrap; | |
color:#000; | |
background:#eee; | |
border-style:solid; | |
border-color:#ccc #aaa #888 #bbb; | |
padding:2px 6px; | |
-moz-border-radius:4px; | |
-webkit-border-radius:4px; | |
border-radius:4px; | |
-moz-box-shadow:0 2px 0 rgba(0, 0, 0, 0.2),0 0 0 1px #ffffff inset; |
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
Sub CollapseHeadings() | |
' Use this code at your own risk | |
' It works for me. I use it in Word documents while in Outline View | |
' for documents set up with Outline View in mind | |
' Remember Ctrl + Pause Break will get break the program | |
On Error GoTo ErrorHandler | |
Dim r As Range, o As Integer, p As Long, f As Boolean | |
Dim currentOutlineLevel, nextOutlineLevel | |
Dim timeout As Integer ' used to pre | |
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
#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"), |
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
freqtable <- function(X) { | |
# X: data.frame of typically survey items | |
# Code assumes that all items are numeric (i.e., 1 to 5, rather than text labels) | |
unique_values <- unique(unlist(sapply(X, unique))) | |
su <- sort(unique_values) | |
freq <- t(sapply(X, function(Z) table(factor(Z, su)))) | |
prop <- t(sapply(X, function(Z) prop.table(table(factor(Z, su))))) | |
list(freq = freq, prop = prop) | |
} |
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
import_csv_qualtrics <- function(file) { | |
# import a csv file exported from Qualtrics | |
# Qualtrics places variable labels in the second row. | |
# This function removes that second row and returns the data frame. | |
# taken from: | |
# http://lowlywonk.blogspot.com.au/2011/05/r-code-to-remove-second-line-of.html | |
DF <- read.csv(file, skip=2, header=FALSE) | |
DF2 <- read.csv(file) | |
names(DF) <- names(DF2) | |
DF |
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
javascript:location %3D %27http://scholar.google.com/scholar%3Fq%3D%27%2Bescape(document.forms%5B0%5D.elements%5B%27q%27%5D.value)%3B |