added R graph drawing functionality