added function update_r and bug fix in is_numeric