Debugging R scripts with command line arguments.

1. Break up the script into two parts: one for reading the arguments, another one for the analysis.
2. Run R with *-args option. It enters the interactive R session.

Example.

R  --args -p ../../input/M00724-foxa1.mat -s ../../input/mouse_promoter_seqs_EPD.fasta -c 0.55 -o testing_

3. Source the the file reading the arguments.
The file can read the arguments with commandArgs() or by using the getopt package.

4. Source the analysis script.

Debugging R scripts with command line arguments 1…
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *