Mercurial > repos > greg > r_hello_world
comparison hello_world.R @ 7:d48f590690fe draft
Uploaded
author | greg |
---|---|
date | Mon, 15 Aug 2016 14:23:44 -0400 |
parents | 24ccb9f7b637 |
children | 5875cb5f42d4 |
comparison
equal
deleted
inserted
replaced
6:24ccb9f7b637 | 7:d48f590690fe |
---|---|
6 options_list <- list( | 6 options_list <- list( |
7 make_option(c("-o", "--output"), action="store", help="Output dataset") | 7 make_option(c("-o", "--output"), action="store", help="Output dataset") |
8 ) | 8 ) |
9 | 9 |
10 parser <- OptionParser(usage="%prog [options] file", options_list) | 10 parser <- OptionParser(usage="%prog [options] file", options_list) |
11 args <- parse+args(parser) | 11 args <- parse_args(parser, positional_arguments=TRUE) |
12 opt <- args$options | 12 opt <- args$options |
13 | 13 |
14 fileConn<-file(opt$output) | 14 fileConn<-file(opt$output) |
15 writeLines(c("Hello","World"), fileConn) | 15 writeLines(c("Hello","World"), fileConn) |
16 close(fileConn) | 16 close(fileConn) |