#Bayes and Bagels Code
A place to stash potentially helpful code for Bayes and Bagels workshop
#Bayes and Bagels Code
A place to stash potentially helpful code for Bayes and Bagels workshop
MPC
The book is pretty self-explanatory about this, but just in case. We can walk through the steps.
First we need some dependencies. Packages the rethinking depends on. We use install.packages to get these.
install.packages(c("coda","mvtnorm","devtools"),repos="http://cran.mtu.edu/")
## Installing packages into '/Users/michaelcolaresi/Library/R/3.2/library'
## (as 'lib' is unspecified)
##
## The downloaded binary packages are in
## /var/folders/f9/2cy3ssy1309cgxyk57db2wnr0000gn/T//RtmpmjpQm7/downloaded_packages
library(devtools)
## Warning: package 'devtools' was built under R version 3.2.5
devtools::install_github("rmcelreath/rethinking")
## Skipping install for github remote, the SHA1 (e71dbc12) has not changed since last install.
## Use `force = TRUE` to force installation
If that worked, then you will be able to type:
library(rethinking)
## Loading required package: rstan
## Warning: package 'rstan' was built under R version 3.2.3
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.4
## rstan (Version 2.9.0-3, packaged: 2016-02-11 15:54:41 UTC, GitRev: 05c3d0058b6a)
## For execution on a local, multicore CPU with excess RAM we recommend calling
## rstan_options(auto_write = TRUE)
## options(mc.cores = parallel::detectCores())
## Loading required package: parallel
## Loading required package: methods
## rethinking (Version 1.58)
and not get an error.
If this does not work (you get a package not found error) then you may need to revert to an older version of the knitr package. Like so:
packageurl <- "http://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.12.tar.gz"
install.packages(packageurl, repos=NULL, type="source")