R_code for ca