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

make attempts to stratify on a Surv object error better #230

Closed
hfrick opened this issue Mar 16, 2021 · 1 comment · Fixed by #231
Closed

make attempts to stratify on a Surv object error better #230

hfrick opened this issue Mar 16, 2021 · 1 comment · Fixed by #231
Labels
feature a feature request or enhancement

Comments

@hfrick
Copy link
Member

hfrick commented Mar 16, 2021

it'd be good to have a simple error message explaining that you can't stratify on a Surv object rather than have the error from survival bubble up.

library(rsample)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(survival)
data("lung")

lung %>% 
  mutate(surv = Surv(time, status)) %>% 
  initial_split(strata = "surv")
#> Error in Ops.Surv(x[hi], qs): Invalid operation on a survival time

Created on 2021-03-16 by the reprex package (v1.0.0)

@github-actions
Copy link

github-actions bot commented Apr 1, 2021

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants