Could this be related to a new if() behavior introduced in v4.2.0 ?
See the "SIGNIFICANT USER-VISIBLE CHANGES" for v4.2.0 in the NEWS
https://cloud.r-project.org/doc/manuals/r-release/NEWS.html
On Sat, Jul 23, 2022 at 6:26 PM Aaron Crowley <aaron at genesisrg.com>
wrote:>
> Approximately 6 months ago, I successfully performed a model-based
> network meta-analysis using the gnls function from the nlme package in
> R (nlme::gnls). In this analysis, a binary response is captured as a
> non-linear non-parametric placebo response model combined with drug
> effect as a function of dose and time and is fitted on aggregate data
> from 57 trials and 13 treatments.
>
> I am now trying to rerun the analysis but the code no longer runs. An
> error message is generated when trying to fit the model using
> nlme::gnls. A reproducible example generating the same error message
> is below.
>
> library(nlme)
>
> set.seed(548)
>
> df <- Soybean
> df$x01 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x02 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x03 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x04 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x05 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x06 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x07 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x08 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x09 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x10 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x11 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
> df$x12 <- sample(c(0, 1), size = nrow(df), replace = TRUE)
>
> gnls(
> weight ~ x,
> data = df,
> params = (x ~ -1 + x01 + x02 + x03 + x04 + x05 + x06 + x07 + x08 +
> x09 + x10 + x11 + x12),
> start = rep(0, 13)
> )
> # Error in if (deparse(params[[nm]][[3]]) != "1") { :
> # the condition has length > 1
>
> sessionInfo()
> # R version 4.2.1 (2022-06-23 ucrt)
> # Platform: x86_64-w64-mingw32/x64 (64-bit)
> # Running under: Windows 10 x64 (build 22000)
> #
> # Matrix products: default
> #
> # locale:
> # [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United
> States.utf8
> # [3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
> # [5] LC_TIME=English_United States.utf8
> #
> # attached base packages:
> # [1] stats graphics grDevices utils datasets methods base
> #
> # other attached packages:
> # [1] nlme_3.1-157
> #
> # loaded via a namespace (and not attached):
> # [1] compiler_4.2.1 tools_4.2.1 grid_4.2.1 lattice_0.20-45
>
> Aaron Crowley
> Principal Scientist, Biostatistics
>
> e. aaron at genesisrg.com
> w. genesisrg.com
>
> ______________________________________________
> 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.
--
Ben Tupper (he/him)
Bigelow Laboratory for Ocean Science
East Boothbay, Maine
http://www.bigelow.org/
https://eco.bigelow.org