Skip to content

Instantly share code, notes, and snippets.

@sahilseth
Last active March 21, 2016 16:54
Show Gist options
  • Save sahilseth/c78c0713c6fd830a52fa to your computer and use it in GitHub Desktop.
Save sahilseth/c78c0713c6fd830a52fa to your computer and use it in GitHub Desktop.
subset a tsv file using R. In this example, get a list of errored commands in flowr.
# idea is to, first filter based on a condition, and then display the results
Rscript -e 'library(dplyr);params::read_sheet("flow_details.txt") %>% filter(exit_code>0)' | less
# we add select, to show only a few columns:
Rscript -e 'library(dplyr);params::read_sheet("flow_details.txt") %>% filter(exit_code>0) %>% select(jobname, jobnm, num, exit_code, cmd)' | less
# add kable, to show results in a markdown format:
Rscript -e 'library(dplyr);library(params);read_sheet("flow_details.txt") %>% filter(exit_code>0) %>% select(jobname, jobnm, num, exit_code, cmd)%>% kable()' | less
# get jobs which are still runnning
Rscript -e 'library(dplyr);params::read_sheet("flow_details.txt") %>% filter(is.na(exit_code))' | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment