Re: [R] How to extract the error flag from 'try'

2013-10-03 Thread Duncan Murdoch
On 03/10/2013 9:09 AM, Dimitri Liakhovitski wrote: Thank you very much! inherits(res, "try-error") is what I was looking for! I would have expected to see this in the ?try examples section, but it's really hidden. I'll look into making it more obvious. Duncan Murdoch On Thu, Oct 3, 2013

Re: [R] How to extract the error flag from 'try'

2013-10-03 Thread Dimitri Liakhovitski
Thank you very much! inherits(res, "try-error") is what I was looking for! On Thu, Oct 3, 2013 at 9:07 AM, Gabor Grothendieck wrote: > On Thu, Oct 3, 2013 at 8:57 AM, Dimitri Liakhovitski > wrote: > > Hello! > > > > I need to flag my operation as an error if it produces an error. > > > > For ex

Re: [R] How to extract the error flag from 'try'

2013-10-03 Thread Gabor Grothendieck
On Thu, Oct 3, 2013 at 8:57 AM, Dimitri Liakhovitski wrote: > Hello! > > I need to flag my operation as an error if it produces an error. > > For example, this expression produces an error: > test<-try(log("a")) > str(test) > > However, how can I proceed using the information contained in test obj

[R] How to extract the error flag from 'try'

2013-10-03 Thread Dimitri Liakhovitski
Hello! I need to flag my operation as an error if it produces an error. For example, this expression produces an error: test<-try(log("a")) str(test) However, how can I proceed using the information contained in test object? I am looking for something like: if test is an error {do this and this}