I've just been asked for more information about R questions, so I'm posting an XML export of two versions of a very simple R question. One version is like the above, using a customised python3 question. The other version is split into two: a prototype to define a new question type Rtest and the actual question that uses that prototype.
Obviously R needs to be installed on Jobe for either of these questions to run.
Please realise I'm not an R programmer and cannot offer any R-specific support.