Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
update dockerfile for the new examples
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskonk committed Sep 6, 2018
1 parent 4e998c8 commit 00cb106
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FROM rocker/geospatial:latest

SHELL ["/bin/bash", "-c"]

RUN R -e 'install.packages(c("diveMove", "trip", "adehabitatLT", "plm", "cshapes", "plumber", "STEPCAM", "MCMCglmm", "MCMCpack", "gdistance", "compositions", "latticeExtra", "ggplot2", "dplyr", "rasterVis", "RColorBrewer", "mapproj", "gridExtra", "ggplot2", "plyr", "reshape2", "wesanderson", "grid", "plotrix", "shotGroups", "reshape", "RSAGA", "pROC", "vcd", "caret", "fields", "extRemes", "truncnorm", "palaeoSig", "rioja", "FME", "SoilR", "verification", "MASS"))'
RUN R -e 'install.packages(c("diveMove", "trip", "adehabitatLT", "plm", "cshapes", "plumber", "STEPCAM", "MCMCglmm", "MCMCpack", "gdistance"))'
RUN R -e 'install.packages(c("compositions", "latticeExtra", "ggplot2", "dplyr", "rasterVis", "RColorBrewer", "mapproj", "gridExtra", "ggplot2"))'
RUN R -e 'install.packages(c("plyr", "reshape2", "wesanderson", "grid", "plotrix", "shotGroups", "reshape", "RSAGA", "pROC", "vcd", "caret", "fields", "extRemes", "truncnorm", "palaeoSig"))'
RUN R -e 'install.packages(c("rioja", "FME", "SoilR", "verification", "MASS", "stringr", "plyr", "lubridate", "metafor", "forecast", "expsmooth", "mice", "mitools", "Zelig", "VIM"))'
RUN R -e 'install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)'
# based on https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a
RUN apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion controllers/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ bindings.manipulateFigure = function(binding, response) {
binding.purpose, binding.result.value, binding.id);
let fileContent = fn.readRmarkdown(binding.id, binding.code.file);
fn.modifyMainfile(fileContent, binding.result, binding.code.file, binding.id);
fileContent = fn.replaceVariable(fileContent, binding.code.parameter);
let codeLines = fn.handleCodeLines(binding.code.codeLines);
let extractedCode = fn.extractCode(fileContent, codeLines);
extractedCode = fn.replaceVariable(extractedCode, binding.code.parameter);
let wrappedCode = fn.wrapCode(extractedCode, binding.id, binding.result.value, binding.code.parameter.val);
fn.saveResult(wrappedCode, binding.id, binding.result.value.replace(/\s/g, '').toLowerCase());
fn.createRunFile(binding.id, binding.result.value.replace(/\s/g, '').toLowerCase(), binding.port);
Expand Down
10 changes: 8 additions & 2 deletions controllers/generalFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,23 @@ fn.wrapCode = function(sourcecode, compendiumId, result, value) {
debug('Start wrapping code');
let get = "#' @get /" + result.replace(/\s/g, '').toLowerCase() + '\n' +
"#' @png \n" +
'function(newValue){ \n';
'function(newValue){ \n' +
'startAnalysis <- Sys.time() \n';
if (!isNaN(value)) {
get = get + 'newValue = as.numeric(newValue) \n';
} else if (value === 'false' || value === 'FALSE' || value === 'true' || value === 'TRUE') {
get = get + 'newValue = as.logical(newValue) \n';
}
let code = sourcecode.split('\n');
//code[code.length-2] = 'print(' + code[code.length-2] + ')';
let newCode = '';
code.forEach(function(elem) {
newCode += elem + '\n';
});
let newContent = get + newCode + '}';
let newContent = get + newCode + 'endAnalysis <- Sys.time() \n' +
'totaltime <- difftime(endAnalysis, startAnalysis, units="secs") \n' +
'message(paste("Total time is: ", totaltime)) \n' +
'}';
debug('End wrapping code');
return newContent;
};
Expand Down

0 comments on commit 00cb106

Please sign in to comment.