Mercurial > repos > greg > r_hello_world
annotate hello_world.R @ 5:a11f7a342777 draft
Uploaded
author | greg |
---|---|
date | Mon, 15 Aug 2016 14:19:09 -0400 |
parents | f3737c086298 |
children | 24ccb9f7b637 |
rev | line source |
---|---|
0 | 1 #!/usr/bin/env Rscript |
2 | |
3 suppressPackageStartupMessages(library("optparse")) | |
4 | |
5 | |
5 | 6 options_list <- list( |
0 | 7 make_option(c("-o", "--output"), action="store", help="Output dataset") |
8 ) | |
9 | |
4 | 10 parser <- OptionParser(usage="%prog [options] file", options_list) |
11 args <- parse+args(parser, positional_arguments=TRUE) | |
12 opt <- args$options | |
13 | |
2 | 14 fileConn<-file(opt$output) |
15 writeLines(c("Hello","World"), fileConn) | |
16 close(fileConn) | |
0 | 17 |
2 | 18 |