Add code and test to reform R<>

Add code and test to reform R<>.