1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| clinical[['os_status']] <- with(clinical, ifelse(vital_status.new == 'Dead', 0, 1)) clinical[['os_time']] <- with(clinical, ifelse(os_status == 0, days_to_death.new, days_to_last_follow_up)) sum(clinical$os_time) clinical[clinical$patient_death_reason == 'Other, non-malignant disease', 'os_status'] = 1 sum(clinical$os_status) clinical[['dcf_status']] <- with(clinical, ifelse(new_neoplasm_event_type == '', 0, 1)) clinical[['dcf_status']] <- with(clinical, ifelse(is.na(dcf_status), 0, dcf_status)) clinical[clinical$biochemical_recurrence == 'YES', 'dcf_status'] = 1 sum(clinical$dcf_status) clinical[['tmp_dcf_time']] <- clinical[['days_to_first_biochemical_recurrence']] clinical[['tmp_dcf_time']] <- with(clinical, ifelse(is.na(tmp_dcf_time), os_time, tmp_dcf_time)) sum(clinical$tmp_dcf_time) clinical[['dcf_time']] <- with(clinical, ifelse(dcf_status == 1, days_to_new_tumor_event_after_initial_treatment, tmp_dcf_time)) clinical[['dcf_time']] <- with(clinical, ifelse(is.na(dcf_time), tmp_dcf_time, dcf_time)) sum(clinical$dcf_time) clinical[['dcf_time']] <- with(clinical, ifelse(biochemical_recurrence == 'YES', tmp_dcf_time, dcf_time)) sum(clinical$dcf_time) clinical <- f_rm_colN(clinical, "tmp_dcf_time") write.csv(clinical, file = 'TCGA-PRAD_clinical.csv') sum(clinical$os_status) sum(clinical$os_time) sum(clinical$dcf_status) sum(clinical$dcf_time)
|