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 <john.lawre...@fda.hhs.gov> 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