R integration working