Skip to content

Instantly share code, notes, and snippets.

@eyberg
Created December 19, 2021 22:20
Show Gist options
  • Save eyberg/923a9dee167c69865895123c59169399 to your computer and use it in GitHub Desktop.
Save eyberg/923a9dee167c69865895123c59169399 to your computer and use it in GitHub Desktop.
eyberg@s1:~/r$ cat config.json
{
"files":["hi.r"],
"Args":["hi.r", "--args", "hello","you"]
}
eyberg@s1:~/r$ ops pkg load R_3.4.4 -c config.json
booting /home/eyberg/.ops/images/R ...
en1: assigned 10.0.2.15
[1] "hello you"
Warning message:
system call failed: Function not implemented
exit status 1
eyberg@s1:~/r$ cat hi.r
say_hello_arg <- function(greet, name) {
args <- commandArgs(TRUE)
name <- args[2]
greet <- args[1]
message <- paste(greet, name, sep = " ")
print(message)
}
say_hello_arg(greet, name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment