The only thing I know about your package is the code you've shared so far, so I 
may be wrong. If I understand correctly, you're using kronecker and dnormfun to 
evalute the normal density at several values of mu and sigma, but a fixed point 
x. And you're fixing that point x in dnormfun, with the possibility of 
redefining dnormfun if you need a new point x. If that is the case, I think you 
can simply do something like


kronecker(X, Y, FUN = dnorm, x = gridY[i]).


But again, maybe I'm missing something.


Max Turgeon
Assistant Professor
Department of Statistics
Department of Computer Science
University of Manitoba
maxturgeon.ca<http://maxturgeon.ca>



________________________________
From: Weimin Zhang <zhan...@hotmail.com>
Sent: February 21, 2020 12:38 PM
To: Max Turgeon; r-package-devel@r-project.org
Subject: Re: no visible binding for '<<-' assignment note

Thank you Max.

The reason I used the super assignment  "<<-"  is because the "dnormfun" 
function later called by function kronecker(X, Y, FUN = "*",...) through FUN=" 
". If I don't use the super assignment  "<<-"  then the kronecker function 
cannot find "dnormfun" function. The question now seems that how I can let the 
kronecker(X, Y, FUN = "*",...) know that "dnormfun" is a "FUN"?

Thanks,
Weimin


________________________________
From: Max Turgeon <max.turg...@umanitoba.ca>
Sent: Thursday, February 20, 2020 10:50 AM
To: Weimin Zhang <zhan...@hotmail.com>; r-package-devel@r-project.org 
<r-package-devel@r-project.org>
Subject: Re: no visible binding for '<<-' assignment note


Hi Weimin,


>From the R docs, if there is no visible binding for the deep assignment, 
>meaning there is the variable "dnormfun" not already defined in the parent 
>environment, then an assignment is made in the global assignment. Is this 
>really what you want to do, define a function "dnormfun" that is available in 
>the user's global environment? If yes, then you'll need to make a case for it 
>in your CRAN submision comments. If no, then you can probably just change 
>"<<-" to "<-".


Best,


Max Turgeon
Assistant Professor
Department of Statistics
Department of Computer Science
University of Manitoba
maxturgeon.ca<http://maxturgeon.ca>


________________________________
From: R-package-devel <r-package-devel-boun...@r-project.org> on behalf of 
Weimin Zhang <zhan...@hotmail.com>
Sent: February 19, 2020 11:48:38 AM
To: r-package-devel@r-project.org
Subject: [R-pkg-devel] no visible binding for '<<-' assignment note

Dear all,
In the last submission of my package the CRAN gave this note: "Check: R code 
for possible problems, Result: NOTE: no visible binding for '<<-' assignment..."

How can I bypass this note?

This is the local function which cause this note:
  dnormfun <<- function(muvalue, sigmavalue, aNumber = gridY[i] ){
    force(aNumber)
    ansvalue=dnorm(aNumber,muvalue,sqrt(sigmavalue))
    return(ansvalue)
  }

The package can run normally at my machine. Any suggestion?

Thanks,

Weimin




        [[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

Reply via email to