[R-pkg-devel] updating my package to fix if () condition has length > 1

2018-05-04 Thread Lawrence, John P

I received the following message from CRAN team autocheck service after 
updating my package:

"

package SurvDisc_0.1.0.tar.gz does not pass the incoming checks automatically, 
please see the following pre-tests:

Windows: 


Status: 1 WARNING

Debian: 


Status: 1 WARNING



Last released version's CRAN status: ERROR: 4, OK: 8

See: 
"

In the check results, it has this message:
"
  Error in if (!is.element(substr(method, 1, 1), c("b", "P"))) { :
the condition has length > 1
  Calls: AsympDiscSurv
  Execution halted
"

But, I had already changed that line to this:

if (!is.element(substr(method[1], 1, 1), c("b", "P"))) {


I know the variable "method" is a single character string, but to handle the 
error checking, I now explicitly tell it to use "method[1]".
Since I already fixed it before re-submitting the package, I don't understand 
why I am getting this error message or even why it still thinks it is using 
"method" instead of "method[1]" in that line.

Thanks,
John




[[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] updating my package to fix if () condition has length > 1

2018-05-04 Thread Maxime Turgeon
Hi John,


I think you misread the check output. You got a WARNING because you didn't 
change the package version (the current 0.1.0 is the same as the incoming 
0.1.0). At the end of the output, you also get the results of R CMD check on 
the current version (i.e. the one on CRAN). Of course, the version on CRAN 
hasn't been updated yet, and this is why you get the ERROR.


Regards,

Max Turgeon


From: R-package-devel  on behalf of 
Lawrence, John P 
Sent: May 4, 2018 1:38:49 PM
To: 'r-package-devel@r-project.org'
Subject: [R-pkg-devel] updating my package to fix if () condition has length > 1


I received the following message from CRAN team autocheck service after 
updating my package:

"

package SurvDisc_0.1.0.tar.gz does not pass the incoming checks automatically, 
please see the following pre-tests:

Windows: 


Status: 1 WARNING

Debian: 


Status: 1 WARNING



Last released version's CRAN status: ERROR: 4, OK: 8

See: 
"

In the check results, it has this message:
"
  Error in if (!is.element(substr(method, 1, 1), c("b", "P"))) { :
the condition has length > 1
  Calls: AsympDiscSurv
  Execution halted
"

But, I had already changed that line to this:

if (!is.element(substr(method[1], 1, 1), c("b", "P"))) {


I know the variable "method" is a single character string, but to handle the 
error checking, I now explicitly tell it to use "method[1]".
Since I already fixed it before re-submitting the package, I don't understand 
why I am getting this error message or even why it still thinks it is using 
"method" instead of "method[1]" in that line.

Thanks,
John




[[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] updating my package to fix if () condition has length > 1

2018-05-04 Thread peter dalgaard
Um, what are you saying here? You are (AFAIK) not going to get that Error 
unless "method" has length > 1. It is not a synthetic check inserted by the 
CRAN nitpickers... Rather than "break the thermometer" by doing method[1], 
perhaps you should diagnose the problem, say by inserting something like

if (length(method) >= 1) {
 warning("'method' has length > 1:")
 print(method)
}

just before the "if (!is.element..." stuff.

-pd 

> On 4 May 2018, at 19:38 , Lawrence, John P  wrote:
> 
> In the check results, it has this message:
> "
>  Error in if (!is.element(substr(method, 1, 1), c("b", "P"))) { :
>the condition has length > 1
>  Calls: AsympDiscSurv
>  Execution halted
> "
> 
> But, I had already changed that line to this:
> 
> if (!is.element(substr(method[1], 1, 1), c("b", "P"))) {
> 
> 
> I know the variable "method" is a single character string, but to handle the 
> error checking, I now explicitly tell it to use "method[1]".

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

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