I have started to use R programming language and I have couple of questions bothering me. I have some background in the shell programming which is pretty easy to learn and use in my opinion. However, I have observed that R language is not so straighforward as it could be.
For example, I have a file called tumor.bam in my working directory. In shell programming I can save it and other .bam files into variable FILE and use it simply by typing;
FILE=./tumor.bam
$FILE
If I want to extract the body of filename and use it somewhere else, I can type;
${FILE%.bam}.bai
My question is: is there same kind of shortcut to handle filenames in the R language? Is there any simple way to perform similar actions in R? I must deal with hundreds of different files and this kind of shortcut would be more than favourable.
Thanks for your help in advance!