Dear R-help listers, I am creating a package for a friend using his scripts and I run into a problem when doing the check. Inside a macro created with gtools::defmacro(par1, expr= ... there is a call to stats::optim and the function for the optimization is called .foo(), which is listed as one of the functions to be included in the package, not to be documented, using package.skeleton. R CMD check reports that it cannot find .foo(). This runs OK as a script but not as a package. I believe it has to do with namespaces. The NAMESPACE file is just this: exportPattern("^[[:alpha:]]+") importFrom("stats", "optim") import(gtools) importFrom("gtools", "defmacro") Any help would be greatly appreciated Ruben -- Ruben H. Roa-Ureta, Ph. D. Consultant, ORCID ID 0000-0002-9620-5224 Center for Environment and Water, Research Institute, King Fahd University of Petroleum and Minerals, KFUPM Box 1927, Dhahran 31261, Saudi Arabia Office Phone : 966-3-860-7850 Cellular Phone : 966-540026401 ?? ????????? ??????? ?? ??? ?????? ?????????? ???????? (?? ????)? ?? ???? ???? ?? ????? ???? ?? ??? ??????? ???? ???????? ?????? ??? ????? ????????? ?? ????? ?????? ?????? ???? ?????? ???? ????. ??? ?? ???? ??? ?? ??? ???? ?? ???????? ? ?? ??????? ?? ????????? ??? ??? ?? ????????? ??? ??? ???. ?? ????? ????? ??? ??????? ???????? ?? ????? ??????? ????????? ???? ??? ??????? ??? ??? ??????? ??? ???????. ??? ???????? ?? ?????? ?????? ???? ?? ??? ??????? ?? ?????? ??? ???????? ??? ???? ???????? ??? ??????? ???????. ??? ?? ????? ??????? ??????? ?? ????? ???? ?? ??? ??????? ???? ?? ????? ?? ?????. DISCLAIMER: The information in this email and its attach...{{dropped:11}}
Dear Ruben I do not think your export pattern matches .foo so that may be the problem. Michael On 05/03/2020 09:10, Ruben wrote:> Dear R-help listers, > > I am creating a package for a friend using his scripts and I run into a > problem when doing the check. > > Inside a macro created with gtools::defmacro(par1, expr= ... there is a > call to stats::optim and the function for the optimization is called > .foo(), which is listed as one of the functions to be included in the > package, not to be documented, using package.skeleton. R CMD check > reports that it cannot find .foo(). This runs OK as a script but not as > a package. I believe it has to do with namespaces. The NAMESPACE file is > just this: > > exportPattern("^[[:alpha:]]+") > importFrom("stats", "optim") > import(gtools) > importFrom("gtools", "defmacro") > > Any help would be greatly appreciated > > Ruben > > -- > Ruben H. Roa-Ureta, Ph. D. > Consultant, ORCID ID 0000-0002-9620-5224 > Center for Environment and Water, Research Institute, > King Fahd University of Petroleum and Minerals, > KFUPM Box 1927, Dhahran 31261, Saudi Arabia > Office Phone : 966-3-860-7850 > Cellular Phone : 966-540026401 > > ?? ????????? ??????? ?? ??? ?????? ?????????? ???????? (?? ????)? ?? > ???? ???? ?? ????? ???? ?? ??? ??????? ???? ???????? ?????? ??? ????? > ????????? ?? ????? ?????? ?????? ???? ?????? ???? ????. ??? ?? ???? ??? > ?? ??? ???? ?? ???????? ? ?? ??????? ?? ????????? ??? ??? ?? ????????? > ??? ??? ???. ?? ????? ????? ??? ??????? ???????? ?? ????? ??????? > ????????? ???? ??? ??????? ??? ??? ??????? ??? ???????. ??? ???????? ?? > ?????? ?????? ???? ?? ??? ??????? ?? ?????? ??? ???????? ??? ???? > ???????? ??? ??????? ???????. ??? ?? ????? ??????? ??????? ?? ????? ???? > ?? ??? ??????? ???? ?? ????? ?? ?????. > > DISCLAIMER: The information in this email and its attach...{{dropped:11}} > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Michael http://www.dewey.myzen.co.uk/home.html
... but this is the wrong list for such questions. Post on r-package-devel if you need further help. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Mar 5, 2020 at 1:15 AM Ruben <ruben at kfupm.edu.sa> wrote:> Dear R-help listers, > > I am creating a package for a friend using his scripts and I run into a > problem when doing the check. > > Inside a macro created with gtools::defmacro(par1, expr= ... there is a > call to stats::optim and the function for the optimization is called > .foo(), which is listed as one of the functions to be included in the > package, not to be documented, using package.skeleton. R CMD check > reports that it cannot find .foo(). This runs OK as a script but not as > a package. I believe it has to do with namespaces. The NAMESPACE file is > just this: > > exportPattern("^[[:alpha:]]+") > importFrom("stats", "optim") > import(gtools) > importFrom("gtools", "defmacro") > > Any help would be greatly appreciated > > Ruben > > -- > Ruben H. Roa-Ureta, Ph. D. > Consultant, ORCID ID 0000-0002-9620-5224 > Center for Environment and Water, Research Institute, > King Fahd University of Petroleum and Minerals, > KFUPM Box 1927, Dhahran 31261, Saudi Arabia > Office Phone : 966-3-860-7850 > Cellular Phone : 966-540026401 > > ?? ????????? ??????? ?? ??? ?????? ?????????? ???????? (?? ????)? ?? ???? > ???? ?? ????? ???? ?? ??? ??????? ???? ???????? ?????? ??? ????? ????????? > ?? ????? ?????? ?????? ???? ?????? ???? ????. ??? ?? ???? ??? ?? ??? ???? > ?? ???????? ? ?? ??????? ?? ????????? ??? ??? ?? ????????? ??? ??? ???. ?? > ????? ????? ??? ??????? ???????? ?? ????? ??????? ????????? ???? ??? > ??????? ??? ??? ??????? ??? ???????. ??? ???????? ?? ?????? ?????? ???? ?? > ??? ??????? ?? ?????? ??? ???????? ??? ???? ???????? ??? ??????? ???????. > ??? ?? ????? ??????? ??????? ?? ????? ???? ?? ??? ??????? ???? ?? ????? ?? > ?????. > > DISCLAIMER: The information in this email and its attach...{{dropped:11}} > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]