View source: R/overlap.Lexis.R
| overlap.Lexis | R Documentation |
When constructing a Lexis object from a data frame with
multiple records there is no guarantee that the records from a given
person will represent disjoint time intervals (epochs), overlap
checks this.
## S3 method for class 'Lexis'
overlap(Lx, ...)
Lx |
A |
... |
ignored |
If no overlapping epochs are found, a message is printed and NULL
is returned. Otherwise a vector of unique ids (from Lx$lex.id)
for the persons with overlapping records is returned invisibly
Bendix Carstensen, http://bendixcarstensen.com, b@bxc.dk
Lexis
# run the DMlate example to get the Lexis object dmi with
# some persons with multiple (2 that is) records:
example(DMlate)
overlap.Lexis(dmi)
#
# now find 4 persons with multiple records
tt <- table(dmi$lex.id)
has2 <- dmi$lex.id %in% names(tt[tt > 1])[1:4]
table(has2)
#
# add time (0.3 y) to lex.dur for these persons to produce overlapping intervals
dmi$lex.dur[has2] <- dmi$lex.dur[has2] + 0.3
(overlap.Lexis(dmi))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.