Jan Hauffa
2020-Apr-11 13:51 UTC
[Rd] Long model specification causes aov() to abort with error
Dear R developers, while experimenting with repeated measures ANOVA, I found out that it is possible to construct a model specification that is syntactically valid, but causes aov() to abort with an error. A minimal reproducer and its output are attached to this mail. I was able to reproduce this problem with the latest SVN revision. The root cause is similar to that of bug 15377: aov() calls deparse() on the model specification. If the resulting string is too long, e.g. due to long column names, deparse() performs line breaking and returns a vector of strings, which aov() does not handle correctly. The attached patch fixes this problem by making aov() call deparse1(). It also corrects an error in the documentation of deparse1(). Please CC me on replies as I am not subscribed to the mailing list. With best regards, Jan Hauffa -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: aov.diff URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20200411/155d7990/attachment.ksh> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: error.txt URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20200411/155d7990/attachment.txt> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: testcase.R URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20200411/155d7990/attachment-0001.ksh>
Martin Maechler
2020-Apr-13 09:45 UTC
[Rd] Long model specification causes aov() to abort with error
>>>>> Jan Hauffa >>>>> on Sat, 11 Apr 2020 15:51:49 +0200 writes:> Dear R developers, > while experimenting with repeated measures ANOVA, I found out that it is > possible to construct a model specification that is syntactically valid, > but causes aov() to abort with an error. A minimal reproducer and its > output are attached to this mail. I was able to reproduce this problem > with the latest SVN revision. > The root cause is similar to that of bug 15377: aov() calls deparse() on > the model specification. If the resulting string is too long, e.g. due > to long column names, deparse() performs line breaking and returns a > vector of strings, which aov() does not handle correctly. > The attached patch fixes this problem by making aov() call deparse1(). > It also corrects an error in the documentation of deparse1(). Thank you. What you write above seems all reasonable (and as a poster who is able to attach 3 different plain text files, named logically (i.e. without calling them <foo>.txt), I pre-judge your programming abilities to be quite high !) I'll look at the cases etc and will use your proposals. (The only question for now: why did you not take the extra step and ask for R-bugs registration and do a regular bug report -> https://www.r-project.org/bugs.html ) Thanks again, Martin Maechler ETH Zurich and R Core Team > Please CC me on replies as I am not subscribed to the mailing list. > With best regards, > Jan Hauffa > x[DELETED ATTACHMENT external: aov.diff, plain text] > x[DELETED ATTACHMENT external: aov-error.txt, plain text] > x[DELETED ATTACHMENT external: aov-testcase.R, plain text] > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel