Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
This file contains hidden or 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
body, td { | |
font-family: 'Lato', sans-serif; | |
background-color: white; | |
font-size: medium; | |
margin: 8px; | |
} | |
tt, code, pre { | |
font-family: Consolas, Monaco, monospace; | |
} |
This file contains hidden or 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
################################################################################ | |
# | |
# R.nanorc -- nano syntax-highlighting file for R | |
# | |
# Origin: This file is part of the pkgutils package for R. | |
# | |
# Usage: This file should be placed in a directory such as /usr/share/nano/ (on | |
# Ubuntu 12.04). That nano uses syntax highlighting at all might need to be | |
# enabled separately. |
This file contains hidden or 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
#Create a user, home directory and set password | |
sudo useradd rstudio | |
sudo mkdir /home/rstudio | |
sudo passwd rstudio | |
sudo chmod -R 0777 /home/rstudio | |
#Update all files from the default state | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains hidden or 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
#Install in order to use RCurl & XML | |
sudo aptitude install libcurl4-openssl-dev | |
sudo apt-get install libxml2-dev |
This file contains hidden or 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
checkPackage <- function (pkg) { | |
# Check if pkg is installed; if not then install it; if an update exists then update | |
# Usage: | |
# > checkPackage("data.table") | |
if (is.character(pkg) == TRUE) { | |
repos <- "https://cloud.r-project.org" | |
if(pkg %in% rownames(installed.packages()) == FALSE) { | |
install.packages(pkg, repos=repos, dependencies=TRUE) | |
rowid <- which(installed.packages()[, "Package"] == pkg) | |
pkgInfo <- installed.packages()[rowid, ] |
This file contains hidden or 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
install.packages("devtools") | |
library("devtools") | |
devtools::install_github("klutometis/roxygen") | |
library(roxygen2) | |
setwd("C:/Users/chanb/Documents/GitHub Repositories") | |
create("prepR") | |
setwd("./prepR") | |
document() |
This file contains hidden or 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
packages <- c("devtools", | |
"data.table", | |
"lubridate", | |
"ggplot2", | |
"haven", | |
"readxl", | |
"tidyr", | |
"lme4", | |
"metafor", | |
"DiagrammeR", |
This file contains hidden or 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
getSynPUF <- function (zipFile) { | |
# [CMS 2008-2010 Data Entrepreneurs' Synthetic Public Use File (DE-SynPUF)](https://www.cms.gov/Research-Statistics-Data-and-Systems/Downloadable-Public-Use-Files/SynPUFs/DE_Syn_PUF.html) | |
# | |
# Examples: | |
# | |
# > getSynPUF("DE1_0_2008_to_2010_Carrier_Claims_Sample_1A.zip") | |
# > getSynPUF("DE1_0_2008_to_2010_Carrier_Claims_Sample_1B.zip") | |
# > getSynPUF("DE1_0_2010_Beneficiary_Summary_File_Sample_1.zip") | |
# | |
require(readr) |
This file contains hidden or 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
/* See http://www.haghish.com/statistics/stata-blog/reproducible-research/markdoc.php */ | |
ssc install markdoc /* installing MarkDoc package */ | |
ssc install weaver /* installing Weaver package */ | |
ssc install statax /* installing Statax package */ | |
markdoc smclfile, replace install export(docx) /* exporting Microsoft Office Docx word */ | |
markdoc adofile, replace install export(sthlp)/* exporting sthlp Stata help file */ |