Skip to content

Instantly share code, notes, and snippets.

@ashim888
Created June 15, 2014 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashim888/e9fbce13aec1770dc617 to your computer and use it in GitHub Desktop.
Save ashim888/e9fbce13aec1770dc617 to your computer and use it in GitHub Desktop.
Random File Name Loop
what<-function(id=1:333){
fileLocation<-paste(getwd(),"/",sep="")
for(i in id){
if(i<10){
fileName<-paste("00",id,".csv",sep="")
return(fileName)
}
else{
fileName<-paste("0",id,".csv",sep="")
return(fileName)
}
#readFile<-read.csv(paste(fileLocation,"specdata/",filename,sep=""))
}
}
@ashim888
Copy link
Author

change id to i
change return to print

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment