use more sophesticated subprocess call to dispatch R job