Hello Michael and thank you for providing a small reproducible example! В Tue, 15 Nov 2022 22:23:30 +0100 "Michael Eisenring" <michael.eisenr...@gmx.ch> пишет:
> model<-as.psem(modlist)#Error: Error in `[.data.frame`(x$data, , > vars) : undefined columns selected If you set options(error = recover) before reproducing the error, you can use the debugger to see the values of both x$data and vars at the moment of crash. See ?recover, ?browser and the free book "R Inferno" for more information. I've taken a look, and I think that it's a bug in some of the functions called by the internal function piecewiseSEM:::formatpsem. The internal function GetData() returns a data.frame with column names of c("Stratum", "Drought", "Year", "cbind(branch_suck_Yes, branch_suck_No)", "N_pc", "Tree.ID"), which gets stored in x$data, after which the function tries to extract variables named c("N_pc", "branch_suck_Yes,branch_suck_No") from x$data. I think you'll have to report this to the maintainer. -- Best regards, Ivan ______________________________________________ R-help@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.