Please make sure you have a recent version of R installed from CRAN (the latest version, 3.6.0, would be best; if you need to use a version older than 3.5, please let me know in advance).
The RStudio interface is strongly recommended; you can download it here (get the free Desktop version).
Install primary fitting packages (and a variety of extras). Note that this list deliberately takes an everything-but-the-kitchen-sink approach, since it will save time to have everything you might want installed in advance. If you have questions or problems, please contact me before the workshop.
## modeling packages
mod_pkgs <- c("alabama", "bbmle", "brms", "DEoptim", "Deriv", "dfoptim",
"glmmTMB", "lme4", "maxLik", "minpack.lm", "minqa", "nimble",
"nloptr", "nls2", "nlshelper", "nlstools", "nls.multstart",
"numDeriv", "optimx", "RcppNumerical",
"repeated", "subplex", "TMB")
## miscellaneous/data manipulation
data_pkgs <- c("benchmark", "devtools", "emdbook",
"pkgbuild", "plyr", "reshape2", "tidyverse")
## graphics
graph_pkgs <- c("cowplot", "directlabels",
"dotwhisker", "GGally", "ggalt", "ggplot2",
"ggpubr", "ggstance", "gridExtra",
"plotrix", "viridis")
all_pkgs <- c(mod_pkgs,data_pkgs,graph_pkgs)
avail_pkgs <- rownames(available.packages())
already_installed <- rownames(installed.packages())
to_install <- setdiff(all_pkgs,already_installed)
if (length(to_install)>0) {
install.packages(to_install,dependencies=TRUE)
}
There is no need to (re)install packages such as grid
, nlme
, MASS
, mgcv
, as they come with a standard R installation.
xcode-select --install
and then click “Install” and “Agree”. (If you have an older version or want more details see here; you only need to do “Step 1” of these instructions.)gcc
/g++
installedAlso see Checking the C++ toolchain from the Stan installation instructions. (Run pkgbuild::has_build_tools(debug=TRUE)
.)
Please check that the following code runs without an error on your system: if it doesn’t, please send me an e-mail (bbolker at gmail.com
) with the error message pasted in to the body of the message.
library(TMB)
writeLines(con="test.cpp",
"#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
DATA_VECTOR(y);
PARAMETER(mu);
Type nll = -sum(dnorm(y, mu, 1, true));
return nll;
}
")
compile("test.cpp")
Last updated: 2019-05-13 18:42:11