0

I have tried using rpy2 in order to generate plots within a python script before, but now I am doing a bit more complicated things within R scripts. Using python I am outputting a number of datafiles, and my R scripts only need the directory and file name to analyze.

Is there an easy way in python to call an r script and pass it directory and filename?

1 Answer 1

3

See the Python subprocess library and RScript

import subprocess
subprocess.call(['Rscript.exe', 'script.r', 'filename'])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.