forked from PEM-Humboldt/biab-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathempty.R
29 lines (23 loc) · 931 Bytes
/
empty.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Script location can be used to access other scripts source
#Sys.getenv("SCRIPT_LOCATION")
## Install required packages
packages <- c("rjson")
new.packages <- packages[!(packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
## Receiving output folder
outputFolder <- commandArgs(trailingOnly=TRUE)[1]
## Receiving arguments from input.json
library("rjson")
input <- fromJSON(file=file.path(outputFolder, "input.json"))
## Script body
<YOUR CODE HERE>
## Outputing result to JSON
output <- list(
# Add your outputs here "key" = "value"
# The output keys correspond to those described in the yml file.
<YOUR OUTPUTS HERE>
#"error" = "Some error", # halt the pipeline
#"warning" = "Some warning", # display a warning without halting the pipeline
)
jsonData <- toJSON(output, indent=2)
write(jsonData, file.path(outputFolder,"output.json"))