HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/R/R-4.4.0/library/nlme/tests/corFactor.R
## test for PR#16110
library(nlme)
Orth <- subset(Orthodont, Subject %in% c("M01","F01"))
cs1CompSymm <- corCompSymm(value = 0.3, form = ~ 1 | Subject)
cs1CompSymm <- Initialize(cs1CompSymm, data = Orth)

## corFactor should return corMatrix(, corr = FALSE) as a vector
Linvt <- corMatrix(cs1CompSymm, corr = FALSE)
stopifnot(all.equal(unlist(Linvt, use.names = FALSE),
                    as.vector(corFactor(cs1CompSymm))))
## failed in 3.1-145 because the corFactor.corCompSymm method was
## misnamed corFactor.compSymm (a non-existent class), such that the
## general corFactor.corStruct method was called instead, which returned
## a different solution for the (transpose inverse) square-root factor