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
foo <- structure(rnorm(100), class = "test") | |
t(foo) |
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
data { | |
int jj_n; | |
int jj_idx[jj_n]; | |
int jj_groups[jj_n]; | |
... | |
} | |
parameters { | |
vector[3] beta; | |
... | |
} |
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
/* | |
A file for testing Stan syntax highlighting. | |
It is not a real model and will not compile | |
*/ | |
# also a comment | |
// also a comment | |
functions { | |
void f1(void a, real b) { | |
return 1 / a; |
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
// Local Level model in Stan | |
// parameterized using Matt's Trick | |
data { | |
int n; | |
vector[n] y; | |
real<lower=0> theta1_mean; | |
real<lower=0> theta1_sd; | |
} | |
parameters { | |
real<lower=0> sigma_v; |
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
intall.packages("devtools") | |
devtools::install_github(c("jrnold/bps5data", "jrnold/bps6data")) |
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
#' CS&SS/SOC/STAT 221 Install Script | |
#' | |
#' Install R Commander and necessary packages and data to be | |
#' used in CS&SS/SOC/STAT 221. | |
#' | |
is_installed <- function(pkg) { | |
is.element(pkg, installed.packages()[,1]) | |
} |
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
list_of_stuff <- | |
list(a = rnorm(100), | |
b = rnorm(100)) | |
with(list_of_stuff, plot(a, b)) |
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
eng_printfile <- function(options) { | |
code <- paste(readLines(options$engine.opts$file), collapse = "\n") | |
options$engine <- options$engine.opts$lang | |
knitr::engine_output(options, code, '') | |
} | |
knitr::knit_engines$set(printfile = eng_printfile) |
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
snippet for | |
for (${1:var} in ${2:start}:${3:end}) { | |
${0} | |
} | |
snippet if | |
if (${1:condition}) { | |
${0} | |
} |
OlderNewer