Hi everyone, I am trying to conduct a synthetic control analysis using the MSCMT package. However, when trying to run it I get a very cryptic error message saying "Error in lst[[nam]][intersect(tim, rownames(lst[[nam]])), cols, drop = FALSE]: subscript out of bounds". Does anyone know what this means and why I receive this error? I attached the code & dataset used in the attachment. Thanks a lot! Best regards Thierry
?s 13:35 de 05/11/2023, Leu Thierry escreveu:> Hi everyone, > > > I am trying to conduct a synthetic control analysis using the MSCMT package. However, when trying to run it I get a very cryptic error message saying "Error in lst[[nam]][intersect(tim, rownames(lst[[nam]])), cols, drop = FALSE]: subscript out of bounds". Does anyone know what this means and why I receive this error? I attached the code & dataset used in the attachment. Thanks a lot! > > > Best regards > > Thierry > > ______________________________________________ > 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.Hello, No attachment came through the filters, can you resend in plain text or if it was a .R file, rename it .txt? See [1], section General Instructions for more on this [1] https://www.r-project.org/mail.html#instructions Hope this helps, Rui Barradas -- Este e-mail foi analisado pelo software antiv?rus AVG para verificar a presen?a de v?rus. www.avg.com
? Sun, 5 Nov 2023 13:35:39 +0000 "Leu Thierry" <thileu at student.ethz.ch> ?????:> However, when trying to run it I get a very cryptic error message > saying "Error in lst[[nam]][intersect(tim, rownames(lst[[nam]])), > cols, drop = FALSE]: subscript out of bounds".Without a way to reproduce the error, I can offer a few bits of generic advice: 1. Use traceback() to find out where the error happens. You can then type the name of the function at the R prompt to read its source code (although most likely without the comments). 2. Even better, set options(error = recover) before running your code and have the debugger launched at the point where the error happens. Use the debugger (see help(browser) to look at every variable and find out why indeed lst[[nam]] doesn't seem to contain rows with names intersect(tim, rownames(lst[[nam]])) and/or columns with names `cols`. 3. See the free book The R Inferno <https://www.burns-stat.com/documents/books/the-r-inferno/> for more advice on debugging R code. -- Best regards, Ivan