Mercurial > repos > greg > r_hello_world
view hello_world.R @ 7:d48f590690fe draft
Uploaded
author | greg |
---|---|
date | Mon, 15 Aug 2016 14:23:44 -0400 |
parents | 24ccb9f7b637 |
children | 5875cb5f42d4 |
line wrap: on
line source
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("optparse")) options_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)