[social4i size="small" align="align-left"][This article was first published onR-posts.com, and kindly contributed toR-bloggers]. (You can report issue about the content on this pagehere)Want to share your content on R-bloggers?click hereif you have a blog, orhereif you don't.A common problem in health registry research is to collapse overlapping hospital stays to a single stay while retaining all information registered for the patient. Let’s start with looking at some example data:pat_id <- c(1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4,4, 5, 5, 5, 5, 5, 5,
...
继续阅读
(54)