[R] Odp: adding column to a matrix

Petr PIKAL petr.pikal at precheza.cz
Tue May 1 13:50:30 CEST 2007


Hi

see ?ifelse

ifelse(censoring>survival, survival, censoring)

Regards

Petr
petr.pikal at precheza.cz

r-help-bounces at stat.math.ethz.ch napsal dne 01.05.2007 13:25:18:

> l have the following dataset and would like to calculate the actual 
survival time by 
>   if censoring time > survival time then actual survival time =survival 
time 
> else its= censoring time.
>         treatmentgrp strata  censoringTime    survivalTime     censoring 
 
> actualsurvivaltim
>      [1,]             1      1       1.012159           1137.80922     0
>    [2,]             2      2      32.971439           247.21786        0
>    [3,]             2      1      85.758253           797.04949        0
>    [4,]             1      1      16.999171            78.92309  0
> 
>   l used matrix to genarate the data
>   thanks in advance
> 
> 
> 
> ---------------------------------
> 
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list