I'm working in R
and I would like to export a txt file putting in its name the value of a particular variable; I read about the command paste
and it works perfectly here:
write.table(mydata,file=paste(cn,"data.txt"))
where cn
is the value to put at the beginning of the file data.txt
. I would like to automatically put this file in an output folder where I keep all the other results. I try to do something like this:
write.table(mydata,file=paste(cn,"./output/data.txt"))
But it doesn't work. Any suggestion?