I have written an R script which includes a loop to download a list of Gsm. However, the url of some Gsms have changed or the condition internet became bad temporarily leading to a break of loop.
I want to continue the loop if some gsms fail to download and the name of gsm is written in a new list.
Then robert advise me the tryCatch function link to C: Geoquery: How to Continue Code Execution on Error
However, i fail to complete the second goal that recording the gsm with warning or error.
My cold is listed below and anyone could help me?
testlist=c("GSMxxx")# There is not a GSMxxx errorrecord=c() warningrecord=c() acc <- testlist[1] address <- "e:/lab/bigdata/originaldata/sample/test/" tryCatch(getGEOfile(acc, destdir = address, AnnotGPL = F,amount=c("data")), warnings=function(war){warningrecord=append(warningrecord,acc)}, error=function(err){errorrecord=append(errorrecord,acc)} )
Thanks a lot!
Deer Robert.
Thanks a lot again. I can not believe that it is also your help guiding me out of the mess.
I am truly feeling frantic about the problem of software sometimes. A little month ago, I did not know what was R and bioconductor!
Could I get your e-mail or any contacts if you are convenient? And my e-mail is r.b.li@foxmail.com. :)
Best regards!
Robin
Nanjing, China