Displaying 1 result from an estimated 1 matches for "soa2".
Did you mean:
sda2
2008 Dec 19
1
How to write a Surv object to a csv-file?
...,
Heinz T?chler
### write Surv-object in csv-file
library(survival)
## create example data
soa <- Surv(1:5, c(0, 0, 1, 0, 1))
df.soa <- data.frame(soa)
write.csv(df.soa, 'df.soa.csv') ## works as I expected
read.csv('df.soa.csv') ## works as I expected
df.soa2 <- data.frame(soa, soa2=soa)
write.csv(df.soa2, 'df.soa2.csv') ## works as I expected
read.csv('df.soa2.csv') ## works as I expected
char1 <- letters[1:5]
df.soac <- data.frame(soa, char1)
write.csv(df.soac, 'df.soac.csv') ## generates the following er...