Hi everyone, I have submitted my package healthyR.au to you CRAN it passes all the Arhubb checks properly but when I submit the CRAN I get an error at the following link https://win-builder.r-project.org/incoming_pretest/healthyR.ai_0.0.6_20220227_175008/ I?m a little confused. Sent from my iPhone www.spsanderson.com
[R-pkg-devel] Submission did not pass incoming checks
4 messages · sps@@derso@ m@iii@g oii gm@ii@com, Serguei Sokol, Ivan Krylov +1 more
Le 27/02/2022 ? 19:15, spsanderson at gmail.com a ?crit?:
Hi everyone, I have submitted my package healthyR.au to you CRAN it passes all the Arhubb checks properly but when I submit the CRAN I get an error at the following link https://win-builder.r-project.org/incoming_pretest/healthyR.ai_0.0.6_20220227_175008/ I?m a little confused.
I don't see any error, only notes and warning. For notes, they are pretty explicit, saying Found if() conditions comparing class() to string: File ???healthyR.ai/R/vec-hai-fourier-discrete.R???: if (class(.x) == "Date") ... As class(x) can be a vector of strings, not just a string, it is much safer to use constructs like 'if (inherits(.x, "Date")) ...' As to the warning, it says that you did not increment the package version which should be done on every new submission. Best, Serguei.
Sent from my iPhone www.spsanderson.com [[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
On Sun, 27 Feb 2022 13:15:43 -0500
spsanderson at gmail.com wrote:
The important part is the following NOTE from https://win-builder.r-project.org/incoming_pretest/healthyR.ai_0.0.6_20220227_175008/Debian/00check.log:
* checking R code for possible problems ... [10s/10s] NOTE Found if() conditions comparing class() to string: File ?healthyR.ai/R/vec-hai-fourier-discrete.R?: if (class(.x) == "Date") ... File ?healthyR.ai/R/vec-hai-fourier-discrete.R?: if (class(.x) == "POSIXct") ... File ?healthyR.ai/R/vec-hai-fourier.R?: if (class(.x) == "Date") ... File ?healthyR.ai/R/vec-hai-fourier.R?: if (class(.x) == "POSIXct") ... File ?healthyR.ai/R/vec-hai-hyperbolic.R?: if (class(.x) == "Date") ... File ?healthyR.ai/R/vec-hai-hyperbolic.R?: if (class(.x) == "POSIXct") ... Use inherits() (or maybe is()) instead.
It even suggests how to solve the problem: use inherits(.x, 'Date') instead of class(.x) == 'Date'. For more information, see the R blog: https://developer.r-project.org/Blog/public/2019/11/09/when-you-think-class.-think-again/index.html
Best regards, Ivan
Thank you all, I did change over to the suggested construct of if(inherits(x = .x, "Date")) etc. and the package was sent off. On Mon, Feb 28, 2022 at 9:23 AM Serguei Sokol <serguei.sokol at gmail.com> wrote:
Le 27/02/2022 ? 19:15, spsanderson at gmail.com a ?crit :
Hi everyone, I have submitted my package healthyR.au to you CRAN it
passes all the Arhubb checks properly but when I submit the CRAN I get an error at the following link
I?m a little confused.
I don't see any error, only notes and warning. For notes, they are pretty explicit, saying Found if() conditions comparing class() to string: File ???healthyR.ai/R/vec-hai-fourier-discrete.R???: if (class(.x) == "Date") ... As class(x) can be a vector of strings, not just a string, it is much safer to use constructs like 'if (inherits(.x, "Date")) ...' As to the warning, it says that you did not increment the package version which should be done on every new submission. Best, Serguei.
Sent from my iPhone
www.spsanderson.com
[[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Steven P Sanderson II, MPH Book on Lulu <http://goo.gl/lmrlFI> Personal Site <http://www.spsanderson.com> [[alternative HTML version deleted]]