R Under development (unstable) (2023-12-13 r85679 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > > library(aster) > > data(echinacea) > > # cut and paste from help(predict.aster) > vars <- c("ld02", "ld03", "ld04", "fl02", "fl03", "fl04", + "hdct02", "hdct03", "hdct04") > redata <- reshape(echinacea, varying = list(vars), direction = "long", + timevar = "varb", times = as.factor(vars), v.names = "resp") > redata <- data.frame(redata, root = 1) > pred <- c(0, 1, 2, 1, 2, 3, 4, 5, 6) > fam <- c(1, 1, 1, 1, 1, 1, 3, 3, 3) > hdct <- grepl("hdct", as.character(redata$varb)) > redata <- data.frame(redata, hdct = as.integer(hdct)) > level <- gsub("[0-9]", "", as.character(redata$varb)) > redata <- data.frame(redata, level = as.factor(level)) > aout <- aster(resp ~ varb + level : (nsloc + ewloc) + hdct : pop, + pred, fam, varb, id, root, data = redata) > # end of cut and paste from help(predict.aster) > > length(aout$dropped) [1] 1 > # so would have had a problem with restart in version 1.0-3 and before > aout <- aster(resp ~ varb + level : (nsloc + ewloc) + hdct : pop, + pred, fam, varb, id, root, data = redata, parm = aout$coefficients, + optout = TRUE) > aout$optout$converged [1] TRUE > aout$optout$iterations == 1 [1] TRUE > > > proc.time() user system elapsed 0.54 0.03 0.56