Fellow R developers,
I can capture usual error message using the normal way:
> tc <- tryCatch(1 + a, error = function(e) e)
> tc
<simpleError: object 'a' not found>
However I have troubles capturing the error message from this type of error:
> tc <- tryCatch(requireNamespace("foobar"), error = function(e) e)
Loading required namespace: foobar
Failed with error: ‘there is no package called ‘foobar’’
> tc
[1] FALSE
Is there any way to capture that specific error message?
Thank you in advance,
Adrian
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel