Re: [R] Possible bug in direct.evidence.plot?

2025-01-06 Thread Miland Joshi
Hello

In R when I looked at the class of nb1 I got:
> class(nb1)
[1] "netmetabin" "netmeta"

which suggests that netmeta might work but netmetabin may cause problems. I'll 
notify Mathias Harrer!

BW
Miland


From: Eric Berger 
Sent: 06 January 2025 08:24
To: Miland Joshi 
Cc: [email protected] 
Subject: Re: [R] Possible bug in direct.evidence.plot?

The explanation is likely that class(x) returns a character vector of length > 
1.
If you go into the code you can achieve what is probably intended without 
triggering this error by replacing that statement with the following:

if (inherits(x,"netmeta")) ...

HTH,
Eric


On Mon, Jan 6, 2025 at 9:57 AM Miland Joshi 
mailto:[email protected]>> wrote:
I succeeded in getting netmetabin to work, but when trying to use 
direct.evidence.plot I ran into a problem:

> nb1evid <- direct.evidence.plot(nb1)
Error in if (class(x) != "netmeta") { : the condition has length > 1

I tried updating netmeta and dmetar (and dmetafor) from R, but the problem 
remains.
Has anyone come across this, and could it be a bug?

Regards
Miland Joshi

[[alternative HTML version deleted]]

__
[email protected]<mailto:[email protected]> mailing list -- To 
UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Possible bug in direct.evidence.plot?

2025-01-06 Thread Eric Berger
This is as I expected. My suggested fix will work in this case.

On Mon, Jan 6, 2025 at 1:03 PM Miland Joshi  wrote:

> Hello
>
> In R when I looked at the class of nb1 I got:
> > class(nb1)
> [1] "netmetabin" "netmeta"
>
> which suggests that netmeta might work but netmetabin may cause problems.
> I'll notify Mathias Harrer!
>
> BW
> Miland
>
> --
> *From:* Eric Berger 
> *Sent:* 06 January 2025 08:24
> *To:* Miland Joshi 
> *Cc:* [email protected] 
> *Subject:* Re: [R] Possible bug in direct.evidence.plot?
>
> The explanation is likely that class(x) returns a character vector of
> length > 1.
> If you go into the code you can achieve what is probably intended without
> triggering this error by replacing that statement with the following:
>
> if (inherits(x,"netmeta")) ...
>
> HTH,
> Eric
>
>
> On Mon, Jan 6, 2025 at 9:57 AM Miland Joshi  wrote:
>
> I succeeded in getting netmetabin to work, but when trying to use
> direct.evidence.plot I ran into a problem:
>
> > nb1evid <- direct.evidence.plot(nb1)
> Error in if (class(x) != "netmeta") { : the condition has length > 1
>
> I tried updating netmeta and dmetar (and dmetafor) from R, but the problem
> remains.
> Has anyone come across this, and could it be a bug?
>
> Regards
> Miland Joshi
>
> [[alternative HTML version deleted]]
>
> __
> [email protected] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

__
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Possible bug in direct.evidence.plot?

2025-01-06 Thread Eric Berger
The explanation is likely that class(x) returns a character vector of
length > 1.
If you go into the code you can achieve what is probably intended without
triggering this error by replacing that statement with the following:

if (inherits(x,"netmeta")) ...

HTH,
Eric


On Mon, Jan 6, 2025 at 9:57 AM Miland Joshi  wrote:

> I succeeded in getting netmetabin to work, but when trying to use
> direct.evidence.plot I ran into a problem:
>
> > nb1evid <- direct.evidence.plot(nb1)
> Error in if (class(x) != "netmeta") { : the condition has length > 1
>
> I tried updating netmeta and dmetar (and dmetafor) from R, but the problem
> remains.
> Has anyone come across this, and could it be a bug?
>
> Regards
> Miland Joshi
>
> [[alternative HTML version deleted]]
>
> __
> [email protected] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.