Skip to content

Packages on OpenCPU

Ruben C. Arslan edited this page Apr 22, 2020 · 13 revisions

For researchers

To get an up-to-date list of packages on OpenCPU, look at https://r-packages.formr.org/

For maintainers

Here's some information for people who maintain an OpenCPU instance.

Dependencies

Some of the following packages have apt-dependencies. At least the following packages are needed minimum by one of the following R packages:

apt-get install build-essential gfortran libapparmor-dev libboost-all-dev \
 libcairo2-dev libcurl4-gnutls-dev libfontconfig1-dev libgfortran-7-dev \
 libgsl-dev libjpeg-dev liblapack-dev libmariadbclient-dev libpng-dev \
 libproj-dev libsodium-dev libssl-dev  libudunits2-dev libxml2-dev mesa-common-dev \
 libglu1-mesa-dev pandoc

List of Packages

Currently, a way to set up packages might be to run:

install.packages(Ncpus = 4, pkgs = c("abind", "acepack", "AER", "AICcmodavg", "akima", "alr4", "Amelia", 
"ape", "aplpack", "arm", "ash", "backports", "BatchExperiments", 
"BatchJobs", "BayesFactor", "bayesplot", "BB", "BBmisc", "bbmle", 
"bdsmatrix", "BH", "BiasedUrn", "bindr", "bindrcpp", "bit", "bit64", 
"bitops", "blme", "blob", "bridgesampling", "brms", "Brobdingnag", 
"broom", "Cairo", "callr", "car", "carData", "caTools", "cellranger", 
"checkmate", "chron", "CircStats", "cmprsk", "coda", "codebook", 
"coin", "colorspace", "colourpicker", "combinat", "commonmark", 
"CompQuadForm", "corpcor", "coxme", "crosstalk", "cubature", 
"d3Network", "data.table", "DBI", "dbplyr", "deldir", "desc", 
"descr", "dfoptim", "DiagrammeR", "dichromat", "doParallel", 
"dotCall64", "downloader", "dplyr", "DT", "dtplyr", "dygraphs", 
"eaf", "effects", "ellipse", "emdbook", "emmeans", "emoa", "Epi", 
"estimability", "etm", "expm", "extrafont", "extrafontdb", "fail", 
"fdrtool", "fields", "fmsb", "FNN", "foreach", "formatR", "Formula", 
"futile.logger", "futile.options", "future", "gamm4", "gdata", 
"gdtools", "gee", "geepack", "genetics", "geosphere", "GGally", 
"ggalt", "ggeffects", "ggforce", "ggfortify", "ggiraph", "ggmap", 
"ggplot2", "ggraph", "ggrepel", "ggthemes", "ggvis", "gistr", 
"glasso", "glmmTMB", "globals", "gmailr", "googlesheets", "googleVis", 
"gplots", "gridBase", "gridExtra", "gridSVG", "gstat", "gtable", 
"gtools", "hexbin", "hflights", "highcharter", "Hmisc", "HSAUR3", 
"htmlTable", "htmltools", "htmlwidgets", "hunspell", "igraph", 
"igraphdata", "influenceR", "inline", "intervals", "irace", "irlba", 
"irr", "iterators", "jpeg", "kinship2", "knitrBootstrap", "koRpus", 
"labeling", "Lahman", "lambda.r", "latticeExtra", "lava", "lavaan", 
"lavaan.survey", "lazyeval", "leaflet", "leaps", "lhs", "likert", 
"lintr", "lisrelToR", "listenv", "lme4", "lmerTest", "lmtest", 
"logspline", "loo", "lpSolve", "lsmeans", "lubridate", "mapproj", 
"maps", "maptools", "MasterBayes", "Matching", "MatchIt", "matrixcalc", 
"MatrixModels", "matrixStats", "maxLik", "mcmc", "MCMCglmm", 
"MCMCpack", "memisc", "merTools", "meta", "MetABEL", "metacom", 
"metafor", "metagen", "metaLik", "metap", "MetaPCA", "MetaSKAT", 
"metatest", "Metatron", "metricsgraphics", "mets", "mgcv", "mi", 
"mice", "miniUI", "minqa", "miscTools", "mnormt", "modelr", "modeltools", 
"mpt", "multcomp", "MuMIn", "munsell", "mvtnorm", "network", 
"nleqslv", "nloptr", "NMF", "nor1mix", "numDeriv", "officer", 
"optextras", "optimx", "orthopolynom", "packrat", "ParamHelpers", 
"pbapply", "pbivnorm", "pbkrtest", "pedigreemm", "permute", "pkgKitten", 
"pkgmaker", "PKI", "plogr", "plotly", "plotROC", "plyr", "png", 
"polspline", "polynom", "praise", "prediction", "prettyunits", 
"prodlim", "progress", "proj4", "proto", "pryr", "psych", "purrr", 
"pwr", "qrencoder", "quadprog", "quantmod", "QuantPsyc", "quantreg", 
"randomForest", "RAppArmor", "raster", "rasterVis", "rbokeh", 
"R.cache", "Rcgmin", "RColorBrewer", "RcppArmadillo", "RcppEigen", 
"RCurl", "readxl", "registry", "rematch", "repr", "reprex", "reshape", 
"reshape2", "rex", "rgexf", "rgl", "rglwidget", "RgoogleMaps", 
"rjson", "RJSONIO", "rlist", "rmarkdown", "rmeta", "R.methodsS3", 
"rms", "rngtools", "rockchalk", "R.oo", "Rook", "roxygen2", "rprojroot", 
"R.rsp", "rsconnect", "RSQLite", "rstan", "rstanarm", "rstantools", 
"Rttf2pt1", "RUnit", "R.utils", "rversions", "rvest", "rvg", 
"Rvmmin", "RWiener", "sandwich", "scales", "scatterplot3d", "selectr", 
"sem", "semTools", "setRNG", "shiny", "shinyAce", "shinyBS", 
"shinyFiles", "shinyjs", "shinystan", "shinythemes", "simsem", 
"sjlabelled", "sjmisc", "sjPlot", "sjstats", "SKAT", "skimr", 
"SMVar", "sna", "snakecase", "sodium", "sourcetools", "sp", "spacetime", 
"spam", "SparseM", "SQUAREM", "StanHeaders", "statmod", "statnet.common", 
"stringdist", "strucchange", "survey", "survival", "svglite", 
"svUnit", "tables", "tensorA", "testthat", "TH.data", "threejs", 
"tidyselect", "tidyverse", "timereg", "TMB", "tripack", "tseries", 
"TTR", "tufte", "tutorial", "tweenr", "twitteR", "ucminf", "udunits2", 
"units", "unmarked", "urlshorteneR", "uuid", "vcd", "vegan", 
"VGAM", "viridis", "viridisLite", "visNetwork", "waffle", "wesanderson", 
"xfun", "XML", "xml2", "xtable", "xts", "Zelig", "zipcode", "zoo", 
"RMySQL", "assertthat", "base64enc", "boot", "brew", "class", 
"cli", "cluster", "codetools", "crayon", "curl", "devtools", 
"digest", "evaluate", "feather", "forcats", "foreign", "git2r", 
"glue", "haven", "highr", "hms", "httpuv", "httr", "jsonlite", 
"KernSmooth", "knitr", "lattice", "magrittr", "markdown", "MASS", 
"Matrix", "memoise", "mime", "nlme", "nnet", "opencpu", "openssl", 
"pander", "pillar", "pkgconfig", "protolite", "R6", "rappdirs", 
"Rcpp", "readr", "rlang", "rpart", "rstudioapi", "sendmailR", 
"spatial", "stringi", "stringr", "sys", "tibble", "unix", "utf8", 
"webutils", "whisker", "withr", "yaml", "zip"))
devtools::install_github("rubenarslan/formr")

There is a bug in OpenCPU where we can get an "unloading error" when updating packages that are part of the core OpenCPU set. Therefore, we should always run the following to remove dupes.

An old package could hide in any library

.libPaths(c( "/usr/local/lib/opencpu/site-library", 
						 "/usr/local/lib/R/site-library",
						 "/usr/lib/R/site-library",
						 "/usr/lib/R/library",   
						"/usr/lib/opencpu/library"  ))

Get a list of duplicated packages

library(tidyverse)
pkgs <- installed.packages()
pkgs <- as.data.frame(pkgs)

dupes <- pkgs %>% select(Package, Version, LibPath) %>% 
	group_by(Package) %>% 
	filter(n_distinct(Version, na.rm = TRUE) > 1) 

Check which version is installed in which library

dupes %>% 
	spread(LibPath, Version) %>% 
	knitr::kable()

Remove any duplicates which older versions

dupes %>% 
	group_by(Package) %>% 
	arrange(desc(Version)) %>% 
	filter(Version != first(Version)) %>% 
	purrr::pmap(~ remove.packages(..1, ..3))
Clone this wiki locally