R resource code