Mercurial > repos > greg > r_hello_world
view hello_world.R @ 4:f3737c086298 draft
Uploaded
author | greg |
---|---|
date | Mon, 15 Aug 2016 14:17:51 -0400 |
parents | fa71365e68b6 |
children | a11f7a342777 |
line wrap: on
line source
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("optparse")) option_list <- list( make_option(c("-o", "--output"), action="store", help="Output dataset") ) parser <- OptionParser(usage="%prog [options] file", options_list) args <- parse+args(parser, positional_arguments=TRUE) opt <- args$options fileConn<-file(opt$output) writeLines(c("Hello","World"), fileConn) close(fileConn)