Hi,
I do have an R script named KO.R. Basically reads thousands of files, whose name has a pattern that differs at a portion of the file name, List.txt.
Row_file1_mile.txt
Row_file2_mile.txt
Row_file3_mile.txt
...
...
Row_file1000_mile.txt
Below is a portion of my Rscript that reads the file.
vi KO.R
Sample =
read.delim("/Users/dropBox/Row_$file_mile.txt")
...
...
...
If I provide the list of the variable portion of the file name like
file1
file2
file3
...
..
file1000
how could I run this script one by one by reading each of the files and execute the script.
This is what I tried by making a .sh file
while read file
do
R CMD BATCH KO.R
done < /Users/dropBox/List.txt
where List.txt contains the list of the variable portion of the file.
Could you please let me know the best way to excecute this R script with in the .sh executable shell script?