It is not clear what you are trying to do. It seems that you have a text file that needs to be converted to Rmd using an R script (why is it not just Rmd for starters?), And then you want to display Rmd. You can do this by running these commands in your terminal:
Rscript Graphs.R Rscript -e "rmarkdown::render('output_file.Rmd')"
The first command runs the Graphs.R file, which supposedly creates output_file.Rmd . The second command launches a single-line, which inserts output_file.Rmd into output_file.html .
If you want to read command line arguments in an R file, try? commandArgs .
args <- commandArgs(trailingOnly = TRUE)
Also see this stack overflow question .
source share