invoke R program via popen function