getEvent: Extract a column from an event history object.

Description Usage Arguments Details Author(s) See Also Examples

View source: R/getEvent.R

Description

Extract a column from an event history object, as obtained with the function Hist.

Usage

1
getEvent(object, mode = "factor", column = "event")

Arguments

object

Object of class "Hist".

mode

Return mode. One of "numeric", "character", or "factor".

column

Name of the column to extract from the object.

Details

Since objects of class "Hist" are also matrices, all columns are numeric or integer valued. To extract a correctly labeled version, the attribute states of the object is used to generate factor levels.

Author(s)

Thomas Alexander Gerds <tag@biostat.ku.dk>

See Also

Hist

Examples

1
2
3
4
5
6
  dat= data.frame(time=1:5,event=letters[1:5])
  x=with(dat,Hist(time,event))
  ## inside integer
  unclass(x)
  ## extract event (the extra level "unknown" is for censored data)
  getEvent(x)

prodlim documentation built on May 19, 2017, 3:53 p.m.

Search within the prodlim package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.