Check host is running at least Ubuntu 16.04
$ cat /etc/issue
Ubuntu 16.04 LTS \n \l
Check host has CUDA capable card with compute capability 3.0 or higher
| #devtools::install_github("wkmor1/msmod") | |
| library(msmod) # for eucs dataset | |
| library(lme4) | |
| library(greta) | |
| sc = function(x) scale(x)[, 1] / 2 # center and scale covariates by 2 sds | |
| # Fit glmer model | |
| m_glmer = glmer( | |
| present ~ sc(logit_rock) + (1 + sc(logit_rock) | species), | |
| data = eucs, family = stats::binomial |
| #' Convert doi to bibtex | |
| #' | |
| #' Convert a digital object identifier (doi) string into a bibtex entry using the | |
| #' webserice \link{http://www.doi2bib.org}. | |
| #' | |
| #' @param doi The character string of the doi. | |
| #' | |
| #' @return a bibtex entry as a character string. | |
| #' | |
| #' @importFrom httr accept content GET |
| rasterToKML <- function(x, out='Rgrid', png=FALSE, name=out, proj="+proj=longlat") { | |
| require(raster) | |
| require(maptools) | |
| require(rgdal) | |
| require(rgeos) | |
| x <- raster(x) | |
| SG <- as(x, 'SpatialGridDataFrame') | |
| proj4string(SG) <- CRS(proj) | |
| SG <- GE_SpatialGrid(SG) | |
| if(png) png <- sprintf('%s.png', out) else png <- tempfile() |
| plot.vc <- | |
| function (model, comps, ylabs) { | |
| vc <- matrix(F, ncol=5, nrow=length(comps)) | |
| row.names(vc) <- comps | |
| for (i in comps) { | |
| vc[i, ] <- quantile( | |
| eval(parse(text=sprintf('model$BUGSoutput$sims.list$%s', i))), | |
| prob = c(0.025, 0.1587, .5, 0.8413, 0.975)) | |
| } | |
| plot.new() |