[R-pkg-devel] Two errors

2025-07-03 Thread Sharon Bewick
1. I�m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable �seq_root2tip�

but seq_root2tip is a function, not a global variable.

2. I�m also getting a NOTE about: no visible global function definition for 
�phy_tree<-�

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don�t know what the problem is�

Thanks!
Sharon

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Sharon Bewick
The problem is that the function that ape exports is way too slow. Using C 
directly really sped up my program, which is a bit slow even at that…



From: Duncan Murdoch 
Date: Thursday, July 3, 2025 at 4:13 PM
To: Sharon Bewick , r-package-devel@r-project.org 

Subject: Re: [R-pkg-devel] Two errors
This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.

On 2025-07-03 5:57 p.m., Sharon Bewick wrote:
> 1. I�m trying to upload my R package. However, I use the ape function 
> seq_root2tip but for the sake of speed am calling it using .Call:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)
>
> How do I get R to recognize the seq_root2tip function from ape in this C 
> call? It is throwing up a NOTE that is getting my package rejected:
>
> shade_branch: no visible binding for global variable �seq_root2tip�

If ape doesn't export seq_root2tip, then you shouldn't use it.  Use
whatever function ape exported.

>
> but seq_root2tip is a function, not a global variable.

In R, most functions are objects, there isn't really a distinction
between variables and functions.

>
> 2. I�m also getting a NOTE about: no visible global function definition for 
> �phy_tree<-�
>
> I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)
>
> I don�t know what the problem is�

"phy_tree" and "phy_tree<-" are two different functions.  Import both of
them (if both are exported).

Duncan Murdoch

>
> Thanks!
> Sharon
>
>   [[alternative HTML version deleted]]
>
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Sharon Bewick
Ah, ok great, thanks.

So I added:
toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode, PACKAGE = 
'ape')

But check() is still throwing up a note:

basic_branch: no visible binding for global variable ‘seq_root2tip’
  shade_branch: no visible binding for global variable ‘seq_root2tip’
  Undefined global functions or variables:
seq_root2tip

Any thoughts?
Sharon

From: Josiah Parry 
Date: Thursday, July 3, 2025 at 4:46 PM
To: Sharon Bewick 
Cc: Michael Chirico , R Package Development 

Subject: Re: [R-pkg-devel] Two errors

This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.
I believe they mean as an argument to .Call
https://stat.ethz.ch/R-manual/R-devel/library/base/html/CallExternal.html

On Thu, Jul 3, 2025 at 15:41 Sharon Bewick 
mailto:sbew...@clemson.edu>> wrote:
Thanks so much for the tips!

I think I’ve fixed #2. But I’m not sure what you mean by #1. Where should the 
"seq_root2tip" with PACKAGE="ape" go? In the NAMESPACE file? In the Description 
file? Somewhere in the code?

So sorry for not understanding!

Thanks!
Sharon

From: Michael Chirico 
mailto:michaelchiri...@gmail.com>>
Date: Thursday, July 3, 2025 at 4:13 PM
To: Sharon Bewick mailto:sbew...@clemson.edu>>
Cc: R Package Development 
mailto:r-package-devel@r-project.org>>
Subject: Re: [R-pkg-devel] Two errors

This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.
1. all functions in R are variables. You can "trick" code tools by writing 
seq_root2tip=NULL in the same scope but consider (a) C routines are typically 
part of a package's private interface (b) it might be preferable to use the 
string "seq_root2tip" with PACKAGE="ape"

2. phytree is not the same as phytree<- : importFrom(phyloseq, "phytree<-") is 
what you want assuming it's exported)

(c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)

Mike C
On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick 
mailto:sbew...@clemson.edu>>>
 wrote:
1. I’m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable ‘seq_root2tip’

but seq_root2tip is a function, not a global variable.

2. I’m also getting a NOTE about: no visible global function definition for 
‘phy_tree<-’

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don’t know what the problem is…

Thanks!
Sharon

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org>
 mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Michael Chirico
1. all functions in R are variables. You can "trick" code tools by writing
seq_root2tip=NULL in the same scope but consider (a) C routines are
typically part of a package's private interface (b) it might be preferable
to use the string "seq_root2tip" with PACKAGE="ape"

2. phytree is not the same as phytree<- : importFrom(phyloseq, "phytree<-")
is what you want assuming it's exported)

(c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)

Mike C

On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick  wrote:

> 1. I’m trying to upload my R package. However, I use the ape function
> seq_root2tip but for the sake of speed am calling it using .Call:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)
>
> How do I get R to recognize the seq_root2tip function from ape in this C
> call? It is throwing up a NOTE that is getting my package rejected:
>
> shade_branch: no visible binding for global variable ‘seq_root2tip’
>
> but seq_root2tip is a function, not a global variable.
>
> 2. I’m also getting a NOTE about: no visible global function definition
> for ‘phy_tree<-’
>
> I have declared phy_tree in the NAMESPACE file:
> importFrom(phyloseq,phy_tree)
>
> I don’t know what the problem is…
>
> Thanks!
> Sharon
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [External] Re: Two errors

2025-07-03 Thread Luke Tierney via R-package-devel

On Thu, 3 Jul 2025, Sharon Bewick wrote:


[You don't often get email from sbew...@clemson.edu. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

The problem is that the function that ape exports is way too slow. Using C 
directly really sped up my program, which is a bit slow even at that…


The ideal approach would be to try to understand why the exported
function is slow and see if that can be improved. Profiling might help.

ape does actually export the variable seq_root2tip for use with
.Call() (see the info in ape::seq_root2tip).  So you can import it and
use is as seq_root2tip or use it as ape::seq_root2tip.

Best,

luke





From: Duncan Murdoch 
Date: Thursday, July 3, 2025 at 4:13 PM
To: Sharon Bewick , r-package-devel@r-project.org 

Subject: Re: [R-pkg-devel] Two errors
This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.

On 2025-07-03 5:57 p.m., Sharon Bewick wrote:

1. I�m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable �seq_root2tip�


If ape doesn't export seq_root2tip, then you shouldn't use it.  Use
whatever function ape exported.



but seq_root2tip is a function, not a global variable.


In R, most functions are objects, there isn't really a distinction
between variables and functions.



2. I�m also getting a NOTE about: no visible global function definition for 
�phy_tree<-�

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don�t know what the problem is�


"phy_tree" and "phy_tree<-" are two different functions.  Import both of
them (if both are exported).

Duncan Murdoch



Thanks!
Sharon

  [[alternative HTML version deleted]]


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


   [[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



--
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
   Actuarial Science
241 Schaeffer Hall  email:   luke-tier...@uiowa.edu
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu/
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Iris Simmons
I believe the suggestion was that you should alternatively write:

.Call("seq_root2tip", nt$edge, length(nt$tip.label), nt$Nnode, PACKAGE = "ape")

however, that generates the following note that CRAN is very unlikely to accept:

* checking foreign function calls ... NOTE
Foreign function call to a different package:
  .Call("seq_root2tip", ..., PACKAGE = "ape")
See chapter 'System and foreign language interfaces' in the 'Writing R
Extensions' manual.

The other possibility is adding:

importFrom(ape, seq_root2tip)

to your NAMESPACE and not modifying your code, but that generates a
different note:

* checking foreign function calls ... NOTE
Registration problem:
  symbol 'seq_root2tip' not in namespace:
   .Call(seq_root2tip, ...)
See chapter 'System and foreign language interfaces' in the 'Writing R
Extensions' manual.

Your best bet is to ask the maintainers of package:ape to add and
export an R function like this:

idk <- function (...)
.Call(seq_root2tip, ...)

There are also ways to do it in C using R_RegisterCCallable and
R_GetCCallable but that might be too complicated for something like
this.

On Thu, Jul 3, 2025 at 6:33 PM Sharon Bewick  wrote:
>
> Thanks so much for the tips!
>
> I think I’ve fixed #2. But I’m not sure what you mean by #1. Where should the 
> "seq_root2tip" with PACKAGE="ape" go? In the NAMESPACE file? In the 
> Description file? Somewhere in the code?
>
> So sorry for not understanding!
>
> Thanks!
> Sharon
>
> From: Michael Chirico 
> Date: Thursday, July 3, 2025 at 4:13 PM
> To: Sharon Bewick 
> Cc: R Package Development 
> Subject: Re: [R-pkg-devel] Two errors
>
> This Message Is From An External Sender: Use caution when opening links or 
> attachments if you do not recognize the sender.
> 1. all functions in R are variables. You can "trick" code tools by writing 
> seq_root2tip=NULL in the same scope but consider (a) C routines are typically 
> part of a package's private interface (b) it might be preferable to use the 
> string "seq_root2tip" with PACKAGE="ape"
>
> 2. phytree is not the same as phytree<- : importFrom(phyloseq, "phytree<-") 
> is what you want assuming it's exported)
>
> (c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)
>
> Mike C
> On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick 
> mailto:sbew...@clemson.edu>> wrote:
> 1. I’m trying to upload my R package. However, I use the ape function 
> seq_root2tip but for the sake of speed am calling it using .Call:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)
>
> How do I get R to recognize the seq_root2tip function from ape in this C 
> call? It is throwing up a NOTE that is getting my package rejected:
>
> shade_branch: no visible binding for global variable ‘seq_root2tip’
>
> but seq_root2tip is a function, not a global variable.
>
> 2. I’m also getting a NOTE about: no visible global function definition for 
> ‘phy_tree<-’
>
> I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)
>
> I don’t know what the problem is…
>
> Thanks!
> Sharon
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing 
> list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Josiah Parry
I think you can put it in quotes so then it won’t be an issue. Other wise
you can use the global variables function:
https://www.r-bloggers.com/2019/08/no-visible-binding-for-global-variable/amp/

On Thu, Jul 3, 2025 at 15:52 Sharon Bewick  wrote:

> Ah, ok great, thanks.
>
>
>
> So I added:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode,
> PACKAGE = 'ape')
>
>
>
> But check() is still throwing up a note:
>
>
>
> basic_branch: no visible binding for global variable ‘seq_root2tip’
>
>   shade_branch: no visible binding for global variable ‘seq_root2tip’
>
>   Undefined global functions or variables:
>
> seq_root2tip
>
>
>
> Any thoughts?
>
> Sharon
>
>
>
> *From: *Josiah Parry 
> *Date: *Thursday, July 3, 2025 at 4:46 PM
> *To: *Sharon Bewick 
> *Cc: *Michael Chirico , R Package Development <
> r-package-devel@r-project.org>
> *Subject: *Re: [R-pkg-devel] Two errors
>
> *This Message Is From An External Sender:* Use caution when opening links
> or attachments if you do not recognize the sender.
>
> I believe they mean as an argument to .Call
>
> https://stat.ethz.ch/R-manual/R-devel/library/base/html/CallExternal.html
>
>
>
> On Thu, Jul 3, 2025 at 15:41 Sharon Bewick  wrote:
>
> Thanks so much for the tips!
>
> I think I’ve fixed #2. But I’m not sure what you mean by #1. Where should
> the "seq_root2tip" with PACKAGE="ape" go? In the NAMESPACE file? In the
> Description file? Somewhere in the code?
>
> So sorry for not understanding!
>
> Thanks!
> Sharon
>
> From: Michael Chirico 
> Date: Thursday, July 3, 2025 at 4:13 PM
> To: Sharon Bewick 
> Cc: R Package Development 
> Subject: Re: [R-pkg-devel] Two errors
>
> This Message Is From An External Sender: Use caution when opening links or
> attachments if you do not recognize the sender.
> 1. all functions in R are variables. You can "trick" code tools by writing
> seq_root2tip=NULL in the same scope but consider (a) C routines are
> typically part of a package's private interface (b) it might be preferable
> to use the string "seq_root2tip" with PACKAGE="ape"
>
> 2. phytree is not the same as phytree<- : importFrom(phyloseq,
> "phytree<-") is what you want assuming it's exported)
>
> (c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)
>
> Mike C
> On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick  sbew...@clemson.edu>> wrote:
> 1. I’m trying to upload my R package. However, I use the ape function
> seq_root2tip but for the sake of speed am calling it using .Call:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)
>
> How do I get R to recognize the seq_root2tip function from ape in this C
> call? It is throwing up a NOTE that is getting my package rejected:
>
> shade_branch: no visible binding for global variable ‘seq_root2tip’
>
> but seq_root2tip is a function, not a global variable.
>
> 2. I’m also getting a NOTE about: no visible global function definition
> for ‘phy_tree<-’
>
> I have declared phy_tree in the NAMESPACE file:
> importFrom(phyloseq,phy_tree)
>
> I don’t know what the problem is…
>
> Thanks!
> Sharon
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Duncan Murdoch

On 2025-07-03 6:32 p.m., Sharon Bewick wrote:
The problem is that the function that ape exports is way too slow. Using 
C directly really sped up my program, which is a bit slow even at that…


You need to be collaborating with the ape maintainer to fix that package 
so it works for your problem.  Most package maintainers are happy to 
accept suggested improvements.


Duncan Murdoch



*From: *Duncan Murdoch 
*Date: *Thursday, July 3, 2025 at 4:13 PM
*To: *Sharon Bewick , r-package-devel@r-project.org 


*Subject: *Re: [R-pkg-devel] Two errors

This Message Is From An External Sender: Use caution when opening links 
or attachments if you do not recognize the sender.


On 2025-07-03 5:57 p.m., Sharon Bewick wrote:

1. I�m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable �seq_root2tip�


If ape doesn't export seq_root2tip, then you shouldn't use it.  Use
whatever function ape exported.



but seq_root2tip is a function, not a global variable.


In R, most functions are objects, there isn't really a distinction
between variables and functions.



2. I�m also getting a NOTE about: no visible global function definition for 
�phy_tree<-�

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don�t know what the problem is�


"phy_tree" and "phy_tree<-" are two different functions.  Import both of
them (if both are exported).

Duncan Murdoch



Thanks!
Sharon

   [[alternative HTML version deleted]]


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel 





__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Josiah Parry
I believe they mean as an argument to .Call
https://stat.ethz.ch/R-manual/R-devel/library/base/html/CallExternal.html

On Thu, Jul 3, 2025 at 15:41 Sharon Bewick  wrote:

> Thanks so much for the tips!
>
> I think I’ve fixed #2. But I’m not sure what you mean by #1. Where should
> the "seq_root2tip" with PACKAGE="ape" go? In the NAMESPACE file? In the
> Description file? Somewhere in the code?
>
> So sorry for not understanding!
>
> Thanks!
> Sharon
>
> From: Michael Chirico 
> Date: Thursday, July 3, 2025 at 4:13 PM
> To: Sharon Bewick 
> Cc: R Package Development 
> Subject: Re: [R-pkg-devel] Two errors
>
> This Message Is From An External Sender: Use caution when opening links or
> attachments if you do not recognize the sender.
> 1. all functions in R are variables. You can "trick" code tools by writing
> seq_root2tip=NULL in the same scope but consider (a) C routines are
> typically part of a package's private interface (b) it might be preferable
> to use the string "seq_root2tip" with PACKAGE="ape"
>
> 2. phytree is not the same as phytree<- : importFrom(phyloseq,
> "phytree<-") is what you want assuming it's exported)
>
> (c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)
>
> Mike C
> On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick  sbew...@clemson.edu>> wrote:
> 1. I’m trying to upload my R package. However, I use the ape function
> seq_root2tip but for the sake of speed am calling it using .Call:
>
> toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)
>
> How do I get R to recognize the seq_root2tip function from ape in this C
> call? It is throwing up a NOTE that is getting my package rejected:
>
> shade_branch: no visible binding for global variable ‘seq_root2tip’
>
> but seq_root2tip is a function, not a global variable.
>
> 2. I’m also getting a NOTE about: no visible global function definition
> for ‘phy_tree<-’
>
> I have declared phy_tree in the NAMESPACE file:
> importFrom(phyloseq,phy_tree)
>
> I don’t know what the problem is…
>
> Thanks!
> Sharon
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Sharon Bewick
Thanks so much for the tips!

I think I’ve fixed #2. But I’m not sure what you mean by #1. Where should the 
"seq_root2tip" with PACKAGE="ape" go? In the NAMESPACE file? In the Description 
file? Somewhere in the code?

So sorry for not understanding!

Thanks!
Sharon

From: Michael Chirico 
Date: Thursday, July 3, 2025 at 4:13 PM
To: Sharon Bewick 
Cc: R Package Development 
Subject: Re: [R-pkg-devel] Two errors

This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.
1. all functions in R are variables. You can "trick" code tools by writing 
seq_root2tip=NULL in the same scope but consider (a) C routines are typically 
part of a package's private interface (b) it might be preferable to use the 
string "seq_root2tip" with PACKAGE="ape"

2. phytree is not the same as phytree<- : importFrom(phyloseq, "phytree<-") is 
what you want assuming it's exported)

(c.f. `x = phyteee(...)` vs. `phytree(x) <- ...`)

Mike C
On Thu, Jul 3, 2025, 2:57 PM Sharon Bewick 
mailto:sbew...@clemson.edu>> wrote:
1. I’m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable ‘seq_root2tip’

but seq_root2tip is a function, not a global variable.

2. I’m also getting a NOTE about: no visible global function definition for 
‘phy_tree<-’

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don’t know what the problem is…

Thanks!
Sharon

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Two errors

2025-07-03 Thread Duncan Murdoch

On 2025-07-03 5:57 p.m., Sharon Bewick wrote:

1. I�m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable �seq_root2tip�


If ape doesn't export seq_root2tip, then you shouldn't use it.  Use 
whatever function ape exported.




but seq_root2tip is a function, not a global variable.


In R, most functions are objects, there isn't really a distinction 
between variables and functions.




2. I�m also getting a NOTE about: no visible global function definition for 
�phy_tree<-�

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don�t know what the problem is�


"phy_tree" and "phy_tree<-" are two different functions.  Import both of 
them (if both are exported).


Duncan Murdoch



Thanks!
Sharon

[[alternative HTML version deleted]]


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [External] Re: Two errors

2025-07-03 Thread Luke Tierney via R-package-devel

On Thu, 3 Jul 2025, Sharon Bewick wrote:


[You don't often get email from sbew...@clemson.edu. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

The problem is that the function that ape exports is way too slow. Using C 
directly really sped up my program, which is a bit slow even at that…


[Just replying to the list since reply-all seems to be bouncing for me]

The ideal approach would be to try to understand why the exported
function is slow and see if that can be improved. Profiling might help.

ape does actually export the variable seq_root2tip for use with
.Call() (see the info in ape::seq_root2tip).  So you can import it and
use is as seq_root2tip or use it as ape::seq_root2tip.

Best,

luke





From: Duncan Murdoch 
Date: Thursday, July 3, 2025 at 4:13 PM
To: Sharon Bewick , r-package-devel@r-project.org 

Subject: Re: [R-pkg-devel] Two errors
This Message Is From An External Sender: Use caution when opening links or 
attachments if you do not recognize the sender.

On 2025-07-03 5:57 p.m., Sharon Bewick wrote:

1. I�m trying to upload my R package. However, I use the ape function 
seq_root2tip but for the sake of speed am calling it using .Call:

toroot<-.Call(seq_root2tip, nt$edge, length(nt$tip.label), nt$Nnode)

How do I get R to recognize the seq_root2tip function from ape in this C call? 
It is throwing up a NOTE that is getting my package rejected:

shade_branch: no visible binding for global variable �seq_root2tip�


If ape doesn't export seq_root2tip, then you shouldn't use it.  Use
whatever function ape exported.



but seq_root2tip is a function, not a global variable.


In R, most functions are objects, there isn't really a distinction
between variables and functions.



2. I�m also getting a NOTE about: no visible global function definition for 
�phy_tree<-�

I have declared phy_tree in the NAMESPACE file: importFrom(phyloseq,phy_tree)

I don�t know what the problem is�


"phy_tree" and "phy_tree<-" are two different functions.  Import both of
them (if both are exported).

Duncan Murdoch



Thanks!
Sharon

  [[alternative HTML version deleted]]


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


   [[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



--
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
   Actuarial Science
241 Schaeffer Hall  email:   luke-tier...@uiowa.edu
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu/
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Changing the title of a package.

2025-07-03 Thread Rolf Turner


On Thu, 5 Jun 2025 19:49:48 -0400
Duncan Murdoch  wrote:

> I'm pretty sure CRAN doesn't care what is in the title, as long as
> 
>   - The new one follows their rules (re capitalization etc.)
>   - The change doesn't follow the last package change too rapidly.
> 
> It would be best if you change the title at the same time as you are 
> releasing other changes to the package.  If the title change is the
> only change in a resubmission, that wastes their time.

For the record, I changed the "Title" field in the DESCRIPTION file (and
made some other adjustments) and resubmitted the package.  The package
got uploaded to CRAN with startling rapidity!

Thanks Duncan.

cheers,

Rolf

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't. (secretaries) phone:
 +64-9-373-7599 ext. 89622
Home phone: +64-9-480-4619

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel