R: Difference between revisions

68 bytes removed ,  2 years ago
Line 161: Line 161:
   |lang="R"
   |lang="R"
   |contents=
   |contents=
# read arguments
args = commandArgs(trailingOnly=TRUE)
args = commandArgs(trailingOnly=TRUE)


Line 169: Line 168:
}
}


# assign arguments to variables
name      <- args[1]                # read first argument as string
name      <- args[1]                # read first argument as string
number    <- as.integer( args[2] )  # read second argument as integer
number    <- as.integer( args[2] )  # read second argument as integer


# use the arguments
print(paste("Processing with name:'", name, "' and number:'", number,"'", sep = ''))
print(paste("Processing with name:'", name, "' and number:'", number,"'", sep = ''))
}}
}}
This script can be used like this:
This script can be used like this:
{{Command
{{Command
cc_staff
653

edits