|
31 | 31 | ### --- Do not remove this uncommented code ------------------------------------ |
32 | 32 |
|
33 | 33 | # wrapperFunction <- function(){ |
34 | | -# inputDF <- maml.mapInputPort(1) |
35 | 34 | # |
36 | | -# if(!is.element("exportenv ",search())) { |
| 35 | +# inputDF <- maml.mapInputPort(1) |
| 36 | +# |
| 37 | +# if(!is.element("exportenv", search())) { |
37 | 38 | # load('src/env.RData') |
38 | 39 | # if(!is.null(exportenv$..packages)) { |
39 | 40 | # lapply(exportenv$..packages, function(pkg){ |
|
48 | 49 | # quietly = TRUE, character.only=TRUE) |
49 | 50 | # } |
50 | 51 | # parent.env(exportenv) = globalenv() |
51 | | -# |
| 52 | +# |
52 | 53 | # attach(exportenv, warn.conflicts = FALSE) |
53 | 54 | # } |
54 | | -# |
| 55 | +# |
55 | 56 | # if(..data.frame){ |
56 | 57 | # outputDF <- as.data.frame(..fun(inputDF)) |
57 | 58 | # colnames(outputDF) <- ..output_names |
|
62 | 63 | # outputDF <- as.data.frame(outputDF) |
63 | 64 | # names(outputDF) <- ..output_names |
64 | 65 | # for(i in 1:nrow(inputDF)){ |
65 | | -# outputDF[i, ] <- do.call('..fun', inputDF[i, ]) |
| 66 | +# outputDF[i, ] <- do.call(..fun, inputDF[i, ]) |
66 | 67 | # } |
67 | 68 | # } |
68 | 69 | # maml.mapOutputPort("outputDF") |
|
73 | 74 |
|
74 | 75 | ### --- End of Do not remove --------------------------------------------------- |
75 | 76 |
|
76 | | -wrapper <- "inputDF <- maml.mapInputPort(1)\nif (!is.element(\"exportenv \", search())) {\n load(\"src/env.RData\")\n if (!is.null(exportenv$..packages)) {\n lapply(exportenv$..packages, function(pkg) {\n if (!require(pkg, character.only = TRUE, quietly = TRUE)) \n install.packages(pkg, repos = paste0(\"file:///\", getwd(), \"/src/packages\"), lib = getwd())\n })\n .libPaths(new = getwd())\n lapply(exportenv$..packages, require, quietly = TRUE, character.only = TRUE)\n }\n parent.env(exportenv) = globalenv()\n attach(exportenv, warn.conflicts = FALSE)\n}\nif (..data.frame) {\n outputDF <- as.data.frame(..fun(inputDF))\n colnames(outputDF) <- ..output_names\n} else {\n outputDF <- matrix(nrow = nrow(inputDF), ncol = length(..output_names))\n outputDF <- as.data.frame(outputDF)\n names(outputDF) <- ..output_names\n for (i in 1:nrow(inputDF)) {\n outputDF[i, ] <- do.call(\"..fun\", inputDF[i, ])\n }\n}\nmaml.mapOutputPort(\"outputDF\")" |
| 77 | +wrapper <- "inputDF <- maml.mapInputPort(1)\nif (!is.element(\"exportenv\", search())) {\n load(\"src/env.RData\")\n if (!is.null(exportenv$..packages)) {\n lapply(exportenv$..packages, function(pkg) {\n if (!require(pkg, character.only = TRUE, quietly = TRUE)) \n install.packages(pkg, repos = paste0(\"file:///\", getwd(), \"/src/packages\"), lib = getwd())\n })\n .libPaths(new = getwd())\n lapply(exportenv$..packages, require, quietly = TRUE, character.only = TRUE)\n }\n parent.env(exportenv) = globalenv()\n attach(exportenv, warn.conflicts = FALSE)\n}\nif (..data.frame) {\n outputDF <- as.data.frame(..fun(inputDF))\n colnames(outputDF) <- ..output_names\n} else {\n outputDF <- matrix(nrow = nrow(inputDF), ncol = length(..output_names))\n outputDF <- as.data.frame(outputDF)\n names(outputDF) <- ..output_names\n for (i in 1:nrow(inputDF)) {\n outputDF[i, ] <- do.call(..fun, inputDF[i, ])\n }\n}\nmaml.mapOutputPort(\"outputDF\")" |
77 | 78 |
|
78 | 79 |
|
79 | 80 |
|
|
0 commit comments