add minsubs option in R scripts; write table out of R plotting scripts