[R-pkg-devel] correcting errors in an existing package
Recently I got a message from CRAN that my package Monte.Carlo.se (on CRAN for the last few years) does not pass current testing. There seemed to be 2 problems: *** 1. * checking LazyData ... NOTE 'LazyData' is specified without a 'data' directory I have this line in my DESCRIPTION file: LazyData: true Should I remove that? * 2. * checking examples with --run-donttest ... [42s/42s] ERROR Running examples in ‘Monte.Carlo.se-Ex.R’ failed The error most likely occurred in: > pairwise.se(hold,xcol=10:12,summary.f=cv) Error: object 'hold' not found Execution halted *** So, I put in the R code to generate the data matrix *hold. *But that brought a host of other errors when checking in Rstudio with > devtools::check("S:/Documents/srcis/a.projects/Monte.Carlo.isr.and.package/Monte.Carlo.se.March.2023") I started seeing the following list about standard functions like sd. N checking R code for possible problems (3.4s) boot.se: no visible global function definition for 'sd' boot.var: no visible global function definition for 'var' corr: no visible global function definition for 'cor' cv: no visible global function definition for 'sd' ratio.mean.sdhat.sd: no visible global function definition for 'sd' ratio.mean.vhat.var: no visible global function definition for 'var' ratio.sd: no visible global function definition for 'sd' ratio.var: no visible global function definition for 'var' varn: no visible global function definition for 'var' Undefined global functions or variables: cor sd var Consider adding importFrom("stats", "cor", "sd", "var") to your NAMESPACE file. But you can't add those functions to NAMESPACE. Well I did but devtools::build() gets rid of it. Also, I keep getting the message in the Rstudio check WARNING 'qpdf' is needed for checks on size reduction of PDFs but I got the latest versions of R and Rstudio and was able to get qpdf to install and loaded with library(qpdf), but Rstudio still gives that message. So, if anybody has any suggestions, I would appreciate it. Thanks. Dennis -- Dennis Boos email: dennis_b...@ncsu.edu Department of StatisticsPhone: 919-515-1918 NC State University Fax: 919-515-1169 Raleigh, NC 27695-8203 http://www4.stat.ncsu.edu/~boos Aim for kindness, tolerance, and humility. [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Vignette rebuilding failed
Hello All, I am in the process of developing an R package ( https://github.com/dbasu-umass/clptheory) and have encountered problems with the vignette. I had initially been able to build the vignette but *after *I added a new function to my package, I have been getting the error message that "Vignette rebuilding failed" when I use devtools:check(). If I use devtools:check(vignette=FALSE), there are no error messages. I can also compile the vignette with knitr. Below is the output from devtools:check(vignette=FALSE) > devtools::check(vignettes = FALSE) ══ Documenting ═ ℹ Updating clptheory documentation ℹ Loading clptheory ══ Building Setting env vars: • CFLAGS: -Wall -pedantic -fdiagnostics-color=always • CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always • CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always ── R CMD build ─ ✔ checking for file ‘/home/basu15/MyRProjects/clptheory/DESCRIPTION’ ... ─ preparing ‘clptheory’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘clptheory_0.0.0.9000.tar.gz’ ══ Checking Setting env vars: • _R_CHECK_CRAN_INCOMING_USE_ASPELL_ : TRUE • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE • _R_CHECK_CRAN_INCOMING_ : FALSE • _R_CHECK_FORCE_SUGGESTS_ : FALSE • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE • NOT_CRAN : true ── R CMD check ─ ─ using log directory ‘/tmp/RtmpCSbZbZ/file3f721a56f9d0/clptheory.Rcheck’ ─ using R version 4.2.3 (2023-03-15) ─ using platform: x86_64-pc-linux-gnu (64-bit) ─ using session charset: UTF-8 ─ using options ‘--no-manual --ignore-vignettes --as-cran’ ✔ checking for file ‘clptheory/DESCRIPTION’ ─ this is package ‘clptheory’ version ‘0.0.0.9000’ ─ package encoding: UTF-8 ✔ checking package namespace information ✔ checking package dependencies (2.5s) ✔ checking if this is a source package ... ✔ checking if there is a namespace ✔ checking for executable files ... ✔ checking for hidden files and directories ... ✔ checking for portable file names ✔ checking for sufficient/correct file permissions ✔ checking serialization versions ... ✔ checking whether package ‘clptheory’ can be installed (7.1s) ✔ checking installed package size ✔ checking package directory ... ✔ checking for future file timestamps ... ✔ checking DESCRIPTION meta-information ... ✔ checking top-level files ... ✔ checking for left-over files ✔ checking index information ✔ checking package subdirectories ... ✔ checking R files for non-ASCII characters ... ✔ checking R files for syntax errors ... ✔ checking whether the package can be loaded (1.8s) ✔ checking whether the package can be loaded with stated dependencies (1.6s) ✔ checking whether the package can be unloaded cleanly (1.6s) ✔ checking whether the namespace can be loaded with stated dependencies (1.6s) ✔ checking whether the namespace can be unloaded cleanly (1.8s) ✔ checking loading without being on the library search path (1.8s) ✔ checking dependencies in R code (1.7s) ✔ checking S3 generic/method consistency (2.4s) ✔ checking replacement functions (1.7s) ✔ checking foreign function calls (1.7s) ✔ checking R code for possible problems (9.5s) ✔ checking Rd files ... ✔ checking Rd metadata ... ✔ checking Rd line widths ... ✔ checking Rd cross-references ... ✔ checking for missing documentation entries (1.7s) ✔ checking for code/documentation mismatches (5.1s) ✔ checking Rd \usage sections (2.5s) ✔ checking Rd contents ... ✔ checking for unstated dependencies in examples ... ✔ checking contents of ‘data’ directory ... ✔ checking data for non-ASCII characters (413ms) ✔ checking LazyData ✔ checking data for ASCII and uncompressed saves ... ─ checking files in ‘vignettes’ ... SKIPPED ✔ checking examples (4.9s) ✔ checking for non-standard things in the check directory ✔ checking for detritus in the temp directory ── R CMD check results ─── clptheory 0.0.0.9000 Duration: 55.1s 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ Below is the output form devtools:check() > devtools::check() ══ Documenting ═══
Re: [R-pkg-devel] correcting errors in an existing package
1. Yes, remove the "lazyData" line from the DESCRIPTION file. 2. Do you have "stats" in the "Imports" line in the DESCRIPTION file? If not, put it in along with the "importFrom" line in the NAMESPACE file. On 3/31/2023 4:51 PM, Dennis Boos wrote: Recently I got a message from CRAN that my package Monte.Carlo.se (on CRAN for the last few years) does not pass current testing. There seemed to be 2 problems: *** 1. * checking LazyData ... NOTE 'LazyData' is specified without a 'data' directory I have this line in my DESCRIPTION file: LazyData: true Should I remove that? * 2. * checking examples with --run-donttest ... [42s/42s] ERROR Running examples in ‘Monte.Carlo.se-Ex.R’ failed The error most likely occurred in: pairwise.se(hold,xcol=10:12,summary.f=cv) Error: object 'hold' not found Execution halted *** So, I put in the R code to generate the data matrix *hold. *But that brought a host of other errors when checking in Rstudio with devtools::check("S:/Documents/srcis/a.projects/Monte.Carlo.isr.and.package/Monte.Carlo.se.March.2023") I started seeing the following list about standard functions like sd. N checking R code for possible problems (3.4s) boot.se: no visible global function definition for 'sd' boot.var: no visible global function definition for 'var' corr: no visible global function definition for 'cor' cv: no visible global function definition for 'sd' ratio.mean.sdhat.sd: no visible global function definition for 'sd' ratio.mean.vhat.var: no visible global function definition for 'var' ratio.sd: no visible global function definition for 'sd' ratio.var: no visible global function definition for 'var' varn: no visible global function definition for 'var' Undefined global functions or variables: cor sd var Consider adding importFrom("stats", "cor", "sd", "var") to your NAMESPACE file. But you can't add those functions to NAMESPACE. Well I did but devtools::build() gets rid of it. Also, I keep getting the message in the Rstudio check WARNING 'qpdf' is needed for checks on size reduction of PDFs but I got the latest versions of R and Rstudio and was able to get qpdf to install and loaded with library(qpdf), but Rstudio still gives that message. So, if anybody has any suggestions, I would appreciate it. Thanks. Dennis __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] correcting errors in an existing package
On 31/03/2023 4:51 p.m., Dennis Boos wrote: Recently I got a message from CRAN that my package Monte.Carlo.se (on CRAN for the last few years) does not pass current testing. There seemed to be 2 problems: *** 1. * checking LazyData ... NOTE 'LazyData' is specified without a 'data' directory I have this line in my DESCRIPTION file: LazyData: true Should I remove that? * 2. * checking examples with --run-donttest ... [42s/42s] ERROR Running examples in ‘Monte.Carlo.se-Ex.R’ failed The error most likely occurred in: pairwise.se(hold,xcol=10:12,summary.f=cv) Error: object 'hold' not found Execution halted *** So, I put in the R code to generate the data matrix *hold. *But that brought a host of other errors when checking in Rstudio with devtools::check("S:/Documents/srcis/a.projects/Monte.Carlo.isr.and.package/Monte.Carlo.se.March.2023") I started seeing the following list about standard functions like sd. N checking R code for possible problems (3.4s) boot.se: no visible global function definition for 'sd' boot.var: no visible global function definition for 'var' corr: no visible global function definition for 'cor' cv: no visible global function definition for 'sd' ratio.mean.sdhat.sd: no visible global function definition for 'sd' ratio.mean.vhat.var: no visible global function definition for 'var' ratio.sd: no visible global function definition for 'sd' ratio.var: no visible global function definition for 'var' varn: no visible global function definition for 'var' Undefined global functions or variables: cor sd var Consider adding importFrom("stats", "cor", "sd", "var") to your NAMESPACE file. But you can't add those functions to NAMESPACE. Well I did but devtools::build() gets rid of it. Also, I keep getting the message in the Rstudio check WARNING 'qpdf' is needed for checks on size reduction of PDFs but I got the latest versions of R and Rstudio and was able to get qpdf to install and loaded with library(qpdf), but Rstudio still gives that message. It sounds as though you're using Roxygen2 to generate your NAMESPACE file. If so, you need @imports directives in the comments (conventionally before the function that uses the import, but I think it doesn't really matter where). Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Vignette rebuilding failed
The error message seems pretty clear: "The function xfun::isFALSE() will be deprecated in the future. Please consider using base::isFALSE(x) or identical(x, FALSE) instead". So don't use xfun::isFALSE(). Duncan Murdoch On 31/03/2023 5:01 p.m., Deepankar Basu wrote: Hello All, I am in the process of developing an R package ( https://github.com/dbasu-umass/clptheory) and have encountered problems with the vignette. I had initially been able to build the vignette but *after *I added a new function to my package, I have been getting the error message that "Vignette rebuilding failed" when I use devtools:check(). If I use devtools:check(vignette=FALSE), there are no error messages. I can also compile the vignette with knitr. Below is the output from devtools:check(vignette=FALSE) devtools::check(vignettes = FALSE) ══ Documenting ═ ℹ Updating clptheory documentation ℹ Loading clptheory ══ Building Setting env vars: • CFLAGS: -Wall -pedantic -fdiagnostics-color=always • CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always • CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always • CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always ── R CMD build ─ ✔ checking for file ‘/home/basu15/MyRProjects/clptheory/DESCRIPTION’ ... ─ preparing ‘clptheory’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘clptheory_0.0.0.9000.tar.gz’ ══ Checking Setting env vars: • _R_CHECK_CRAN_INCOMING_USE_ASPELL_ : TRUE • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE • _R_CHECK_CRAN_INCOMING_ : FALSE • _R_CHECK_FORCE_SUGGESTS_ : FALSE • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE • NOT_CRAN : true ── R CMD check ─ ─ using log directory ‘/tmp/RtmpCSbZbZ/file3f721a56f9d0/clptheory.Rcheck’ ─ using R version 4.2.3 (2023-03-15) ─ using platform: x86_64-pc-linux-gnu (64-bit) ─ using session charset: UTF-8 ─ using options ‘--no-manual --ignore-vignettes --as-cran’ ✔ checking for file ‘clptheory/DESCRIPTION’ ─ this is package ‘clptheory’ version ‘0.0.0.9000’ ─ package encoding: UTF-8 ✔ checking package namespace information ✔ checking package dependencies (2.5s) ✔ checking if this is a source package ... ✔ checking if there is a namespace ✔ checking for executable files ... ✔ checking for hidden files and directories ... ✔ checking for portable file names ✔ checking for sufficient/correct file permissions ✔ checking serialization versions ... ✔ checking whether package ‘clptheory’ can be installed (7.1s) ✔ checking installed package size ✔ checking package directory ... ✔ checking for future file timestamps ... ✔ checking DESCRIPTION meta-information ... ✔ checking top-level files ... ✔ checking for left-over files ✔ checking index information ✔ checking package subdirectories ... ✔ checking R files for non-ASCII characters ... ✔ checking R files for syntax errors ... ✔ checking whether the package can be loaded (1.8s) ✔ checking whether the package can be loaded with stated dependencies (1.6s) ✔ checking whether the package can be unloaded cleanly (1.6s) ✔ checking whether the namespace can be loaded with stated dependencies (1.6s) ✔ checking whether the namespace can be unloaded cleanly (1.8s) ✔ checking loading without being on the library search path (1.8s) ✔ checking dependencies in R code (1.7s) ✔ checking S3 generic/method consistency (2.4s) ✔ checking replacement functions (1.7s) ✔ checking foreign function calls (1.7s) ✔ checking R code for possible problems (9.5s) ✔ checking Rd files ... ✔ checking Rd metadata ... ✔ checking Rd line widths ... ✔ checking Rd cross-references ... ✔ checking for missing documentation entries (1.7s) ✔ checking for code/documentation mismatches (5.1s) ✔ checking Rd \usage sections (2.5s) ✔ checking Rd contents ... ✔ checking for unstated dependencies in examples ... ✔ checking contents of ‘data’ directory ... ✔ checking data for non-ASCII characters (413ms) ✔ checking LazyData ✔ checking data for ASCII and uncompressed saves ... ─ checking files in ‘vignettes’ ... SKIPPED ✔ checking examples (4.9s) ✔ checking for non-standard things in the check directory ✔ checking for detritus in the temp directory ── R CMD check results
Re: [R-pkg-devel] Vignette rebuilding failed
> Error(s) in re-building vignettes: >... > --- re-building ‘lvpp.Rmd’ using rmarkdown > Quitting from lines 11-15 (lvpp.Rmd) > Error: processing vignette 'lvpp.Rmd' failed with diagnostics: > The function xfun::isFALSE() will be deprecated in the future. Please >consider using base::isFALSE(x) or identical(x, FALSE) instead. > --- failed re-building ‘lvpp.Rmd’ The error message means a function (knitr::opts_chunk$set) called xfun::isFALSE() in lines 11-15 (lvpp.Rmd). However, knitr::opts_chunk$set stopped using xfun::isFALSE(). See the commit shown below. https://github.com/yihui/knitr/commit/ccb07c4c226f7375e5df242103672bd629ac Updating knitr package should fix the error. I tested your package on my Ubuntu machine and got no error even after removing vignettes from .Rbuildignore. I believe the cause of the error is not your package but your environment. Best, Shota Ochi 2023年4月2日(日) 6:44 Duncan Murdoch : > The error message seems pretty clear: "The function xfun::isFALSE() > will be deprecated in the future. Please consider using base::isFALSE(x) > or identical(x, FALSE) instead". > > So don't use xfun::isFALSE(). > > Duncan Murdoch > > > > On 31/03/2023 5:01 p.m., Deepankar Basu wrote: > > Hello All, > > > > I am in the process of developing an R package ( > > https://github.com/dbasu-umass/clptheory) and have encountered problems > > with the vignette. > > > > I had initially been able to build the vignette but *after *I added a new > > function to my package, I have been getting the error message that > > "Vignette rebuilding failed" when I use devtools:check(). > > > > If I use devtools:check(vignette=FALSE), there are no error messages. I > can > > also compile the vignette with knitr. > > > > Below is the output from devtools:check(vignette=FALSE) > >> devtools::check(vignettes = FALSE) > > ══ Documenting > > > ═ > > ℹ Updating clptheory documentation > > ℹ Loading clptheory > > > > ══ Building > > > > > Setting env vars: > > • CFLAGS: -Wall -pedantic -fdiagnostics-color=always > > • CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always > > • CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always > > • CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always > > • CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always > > • CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always > > ── R CMD build > > > ─ > > ✔ checking for file ‘/home/basu15/MyRProjects/clptheory/DESCRIPTION’ ... > > ─ preparing ‘clptheory’: > > ✔ checking DESCRIPTION meta-information ... > > ─ checking for LF line-endings in source and make files and shell > scripts > > ─ checking for empty or unneeded directories > > ─ building ‘clptheory_0.0.0.9000.tar.gz’ > > > > ══ Checking > > > > > Setting env vars: > > • _R_CHECK_CRAN_INCOMING_USE_ASPELL_ : TRUE > > • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE > > • _R_CHECK_CRAN_INCOMING_ : FALSE > > • _R_CHECK_FORCE_SUGGESTS_ : FALSE > > • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE > > • NOT_CRAN : true > > ── R CMD check > > > ─ > > ─ using log directory > ‘/tmp/RtmpCSbZbZ/file3f721a56f9d0/clptheory.Rcheck’ > > ─ using R version 4.2.3 (2023-03-15) > > ─ using platform: x86_64-pc-linux-gnu (64-bit) > > ─ using session charset: UTF-8 > > ─ using options ‘--no-manual --ignore-vignettes --as-cran’ > > ✔ checking for file ‘clptheory/DESCRIPTION’ > > ─ this is package ‘clptheory’ version ‘0.0.0.9000’ > > ─ package encoding: UTF-8 > > ✔ checking package namespace information > > ✔ checking package dependencies (2.5s) > > ✔ checking if this is a source package ... > > ✔ checking if there is a namespace > > ✔ checking for executable files ... > > ✔ checking for hidden files and directories ... > > ✔ checking for portable file names > > ✔ checking for sufficient/correct file permissions > > ✔ checking serialization versions ... > > ✔ checking whether package ‘clptheory’ can be installed (7.1s) > > ✔ checking installed package size > > ✔ checking package directory ... > > ✔ checking for future file timestamps ... > > ✔ checking DESCRIPTION meta-information ... > > ✔ checking top-level files ... > > ✔ checking for left-over files > > ✔ checking index information > > ✔ checking package subdirectories ... > > ✔ checking R files for non-ASCII characters ... > > ✔ checking R files for syntax errors ... > > ✔ checking whether the package can be loaded (1.8s) > > ✔ checking whet
Re: [R-pkg-devel] correcting errors in an existing package
On Fri, 31 Mar 2023 16:51:40 -0400 Dennis Boos wrote: > Also, I keep getting the message in the Rstudio check > > WARNING >'qpdf' is needed for checks on size reduction of PDFs > > > but I got the latest versions of R and Rstudio and was able to get > qpdf to install and loaded with library(qpdf), but Rstudio still gives > that message. Almost there. The 'qpdf' package interfaces to the same code that the 'qpdf' command line tool uses to do its job. R CMD check uses the latter, not the former. It looks like you're on Windows, so you need to install Rtools in order to get a compatible version of 'qpdf': https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html -- Best regards, Ivan __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel