diff --git a/demo.R b/demo.R new file mode 100644 index 0000000..b9f6802 --- /dev/null +++ b/demo.R @@ -0,0 +1,24 @@ +# author: Tiffany Timbers +# date: 2020-01-15 + +"This script prints out docopt args. +Usage: demo.R --arg2= [--arg3=] [] + +Options: + Takes any value (this is a required positional argument) +--arg2= Takes any value (this is a required option) +[--arg3=] Takes any value (this is an optional option) +[] Takes any value (this is an optional positional argument) +" -> doc + +library(docopt) +opt <- docopt(doc) + +main <- function(opt, arg4){ + print(opt) + print(typeof(opt)) + print(paste0("The value for arg4 is ",arg4, " and the type of arg4 is ", typeof(arg4))) +} + +main(opt, opt$arg4) +