Fills out the missing information for follow up of persons in a Lexis diagram if sufficient information is given.
1 2 3 4 5 6
Vectors defining lifelines to be plotted in the diagram. At least three must be given to produce a result. Not all subsets of three will suffice, the given subset has to define life lines. If insufficient data is given, nothing is returned and a warning is given.
Data frame with variables
birth.date, with all entries computed for each person. If any
birth.date are of
Date or if any of
risk.time are of class
difftime the date variables will
be of class
Date and the other three of class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
( Life.lines( entry.age = c(3,30,45), risk.time = c(25,5,14), birth.date = c(1970,1931,1925.7) ) ) # Draw a Lexis diagram Lexis.diagram() # Compute entry and exit age and date. ( LL <- Life.lines( entry.age = c(3,30,45), risk.time = c(25,5,14), birth.date = c(1970,1931,1925.7) ) ) segments( LL[,1], LL[,2], LL[,3], LL[,4] ) # Plot the life lines. # Compute entry and exit age and date, supplying a date variable bd <- ( c(1970,1931,1925.7) - 1970 ) * 365.25 class( bd ) <- "Date" ( Life.lines( entry.age = c(3,30,45), risk.time = c(25,5,14), birth.date = bd ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.