Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitMulti breaks the breaks (with R date format) #123

Open
mattirantanen opened this issue Oct 25, 2016 · 1 comment
Open

splitMulti breaks the breaks (with R date format) #123

mattirantanen opened this issue Oct 25, 2016 · 1 comment
Assignees
Labels

Comments

@mattirantanen
Copy link
Collaborator

splitMulti chances date formatted break values to integer values (i.e. days since 1970...) in attributes.

I think the last line should return TRUE

x <- lexpand(sire,status = status != 0,
          birth = bi_date, entry = dg_date, exit = ex_date,
          pophaz=popmort)

Brr <- list(per = c("2003-01-01","2008-01-01", "2013-01-01"))
x <- splitMulti(x, breaks = Brr)
get_breaks(x) == Brr
@WetRobot
Copy link
Collaborator

WetRobot commented Oct 25, 2016

I'll look into it. Another example:

> library("Epi")
> data("sire", package = "popEpi")
> x <- Lexis(data=sire, entry = list(fot=0, per=dg_date, age=dg_date-bi_date), 
+            exit=list(per=ex_date), exit.status=status)
Warning message:
In Lexis(data = sire, entry = list(fot = 0, per = dg_date, age = dg_date -  :
  Dropping 16 rows with duration of follow up < tol

> 
> BL <- list(per = as.Date(c("2008-01-01", "2012-12-31")))
> 
> str(BL)
List of 1
 $ per: Date[1:2], format: "2008-01-01" "2012-12-31"
> 
> x2 <- splitMulti(x, breaks = BL)
> 
> str(get_breaks(x2))
List of 1
 $ per: num [1:2] 13879 15705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants