I cannot figure out how to read from file based on command line argument:( All the answers I was able too google seemed too complicated.
I want to run this script from command line and let $1 be replaced by name of file I pass as an argument.
#!/usr/bin/Rscript
duplication<- read.table($1, header=T)
options(scipen=10)
plot(duplication$x,duplication$y,col="blue");
So that by typing
R CMD BATCH script.R path_to_file
I want to read file and ideally output graph with the same name as was the name of file.