user6549804
user6549804

Reputation:

In R, why does the length() and nrow() functions return different values on the Surv object?

I have this Surv object called y1. When I call the length() and nrow() function on it, I get different values. By inspection, y1 seems to have the number of elements that nrow() returns. Why does length() not work?

y1 <- Surv(time = inputTime, event = inputEvent, type = "right")

Upvotes: 1

Views: 200

Answers (1)

user6549804
user6549804

Reputation:

Since this Surv object has two columns, length() would give the total number of cells.

Answer courtesy by joran.

Upvotes: 1

Related Questions