A pull request updating the lexer for R has been recently merged upstream[0]. As this issue is due to incorrect parsing, it is worth investigating whether the improved lexer helps with $SUBJECT.
[0] https://bitbucket.org/birkenfeld/pygments-main/pull-requests/680/slexer-improvements/diff