R Under development (unstable) (2024-06-05 r86695 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > stopifnot(!any("package:nlme" == search())) # nlme *not* attached > > ll <- LETTERS[1:10] > subs <- rep(ll, rep(3,10)) > set.seed(101)# make reproducible > resp <- rnorm(30) > > ## 'nlme' not in search() : > op <- options(warn = 2) # there should be no (deprecation) warning > (gd <- nlme::groupedData(resp ~ 1|subs)) Grouped Data: resp ~ 1 | subs resp subs 1 -0.3260365 A 2 0.5524619 A 3 -0.6749438 A 4 0.2143595 B 5 0.3107692 B 6 1.1739663 B 7 0.6187899 C 8 -0.1127343 C 9 0.9170283 C 10 -0.2232594 D 11 0.5264481 D 12 -0.7948444 D 13 1.4277555 E 14 -1.4668197 E 15 -0.2366834 E 16 -0.1933380 F 17 -0.8497547 F 18 0.0584655 F 19 -0.8176704 G 20 -2.0503078 G 21 -0.1637557 G 22 0.7085221 H 23 -0.2679805 H 24 -1.4639218 H 25 0.7444358 I 26 -1.4103902 I 27 0.4670676 I 28 -0.1193201 J 29 0.4672390 J 30 0.4981356 J > options(op) > ## failed in nlme < 3.1-129 (or previous to 2017-01-17) > stopifnot(inherits(gd, "groupedData"), + identical(dim(gd), c(30L, 2L)), + inherits(gs <- gd[,"subs"], "ordered"), + identical(sort(levels(gs)), ll), + identical(sort.list(levels(gs)), + c(5L, 9L, 8L, 4L, 10L, 2L, 1L, 6L, 7L, 3L))) > > ## PR#18177 -- [j] should give a data frame > require(nlme) Loading required package: nlme > stopifnot(is.data.frame(Meat[2]) # had 'drop=TRUE' + , identical(Meat[,1, drop=FALSE], Meat[1]) + ) # gave vector in nlme < 3.1-153 > > proc.time() user system elapsed 0.15 0.04 0.18