[R] check availability of a file in R

Farhad Shokoohi statfar at gmail.com
Wed Sep 7 02:07:18 CEST 2011


I need to use a loop and each time go to folder i and check availability of .RData file. If it exist load it and if not submit a command in linux. Something like this

for (i in 1:10){
	setwd(~/i/)
	if .Rdata (?????)
	load (.RData
	else 
	<run a command in linux like " cd ~/i/  ;  qsub job$i.pbs" >
}

Any idea how to do that in R?

Farhad



More information about the R-help mailing list