# Load the library.
library("survival")
# Print first few rows.
print(head(pbc))
# Load the library.
library("survival")
# Create the survival object.
survfit(Surv(pbc$time,pbc$status == 2)~1)
# Give the chart file a name.
png(file = "survival.png")
# Plot the graph.
plot(survfit(Surv(pbc$time,pbc$status == 2)~1))
# Save the file.
dev.off()
为什么我的plot出不来图,麻烦大家帮我看一下