Mercurial > repos > mingchen0919 > one_command_liners
comparison tool_template_render.R @ 9:a9f93a4742b1 draft
update
| author | mingchen0919 |
|---|---|
| date | Fri, 23 Feb 2018 15:42:48 -0500 |
| parents | ac0c560845dc |
| children | 670e1591cc65 |
comparison
equal
deleted
inserted
replaced
| 8:ac0c560845dc | 9:a9f93a4742b1 |
|---|---|
| 15 ) | 15 ) |
| 16 ) | 16 ) |
| 17 opt = getopt::getopt(spec_matrix) | 17 opt = getopt::getopt(spec_matrix) |
| 18 opt | 18 opt |
| 19 | 19 |
| 20 # build command: awk '{print $1,$2}' > output.txt and run | 20 rmarkdown::render(input = opt$X_t, output_file = opt$X_O) |
| 21 X_A = paste0(paste0('$', trimws(strsplit(opt$X_A, ',')[[1]])), collapse = ',') | |
| 22 extract_field_command = paste0("awk '{print ", X_A, " }' ", opt$X_B, " > ", opt$X_O) | |
| 23 system(command = extract_field_command) | |
| 24 | 21 |
| 25 sink() | 22 sink() |
