Skip to content
Back to formatted view

Raw Message

Message-ID: <1F0886F8-543C-44BA-BD45-FC9221814DFC@sjtu.edu.cn>
Date: 2008-12-01T08:17:26Z
From: Jiang Peng
Subject: how to ignore errors

Dear listers,

  Hi .

  I googled before I ask this question in case to avoid violating the  
"list law". The question was proposed by somebody else but nobody  
gives a proper solution.

  How to ignore errors in a R loop? I have a R source file ,namely,  
test.r.
  I ran a loop in a command line

  > for(i in 1 : 100 ) {source("test.r",echo =T ) }

  and I found that when test.r have some error the loop will stop, but  
test.r is just stochastically wrong,i.e., sometimes it works well if  
no bad values return.
  I want to know how to ignore such errors and let the loop continue.

thanks in advance.
_______________________

Jiang Peng, Ph.D. Candidate
Department of Mathematics &
Antai college of Economics and Management
Shanghai Jiao Tong University
Address: Room 431, #3 Building, Xuhui Campus
E-mail: jp021 at sjtu.edu.cn
              jp021 at 126.com
MSN: jp021 at hotmail.com
iChat: mathfrog at mac.com
Mobile: +86-138 168 780 95