Status: experimental, for own education only, possibly subject to change, still quite slow

Author: Peter Meißner

Licence: GPL-2

Description:

Merging time span data used for survival analysis via building new spans out of overlapping spans. For each context change (id1 data changes | id2 data changes) a new span is formed. Spans neither covered within dataset 1 nor 2 are put into separate spans.



Installation and start - development version

devtools::install_github("petermeissner/spanmatcher")
library(spanmatcher)



Usage

Loading the package and making up some data

library(spanmatcher)

df1 = data.frame(
  id1 = letters[1:5],
  from2 = as.Date(c(1,3,4,7,8), origin = "1970-01-01"),
  to2   = as.Date(c(2,4,5,9,10), origin = "1970-01-01")
)

df2 = data.frame(
  id2   = LETTERS[11:13],
  from2 = as.Date(c(2,7,7), origin = "1970-01-01"),
  to2   = as.Date(c(5,9,11), origin = "1970-01-01")
) 

df1

df2

Mergin/joining the data

span_matcher(df1, df2)

Splitting spans

span_matcher(df1,df2, split_after = c(4))
span_matcher(df1,df2, split_before = c(10))



Contribution

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms:

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/



petermeissner/spanmatcher documentation built on May 25, 2019, 1:58 a.m.