If you would like to save the error message instead of suppressing it, you
can use tryCatch(message=function(e)e, ...).

-BIll

On Tue, Nov 28, 2023 at 3:55 AM Adrian Dusa <[email protected]> wrote:

> Once again, Ivan, many thanks.
> Yes, that does solve it.
> Best wishes,
> Adrian
>
> On Tue, Nov 28, 2023 at 11:28 AM Ivan Krylov <[email protected]>
> wrote:
>
> > В Tue, 28 Nov 2023 10:46:45 +0100
> > Adrian Dusa <[email protected]> пишет:
> >
> > > tryCatch(requireNamespace("foobar"), error = function(e) e)
> >
> > I think you meant loadNamespace() (which throws errors), not
> > requireNamespace() (which internally uses tryCatch(loadNamespace(...))
> > and may or may not print the error depending on the `quietly` argument).
> >
> > --
> > Best regards,
> > Ivan
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to