Skip to content

Allow as_survey_design objects to work inside tidymodels #140

@themichjam

Description

@themichjam

I'm wondering if it would be possible to allow srvyr survey design objects to work with tidymodels. Example below (with error):

library(survey)
library(srvyr)
library(tidymodels)
data(api)

# stratified sample
dstrata <- apistrat %>%
  as_survey_design(strata = stype,
weights = pw)

# initial_split
dstrat_split <- initial_split(dstrata)

# Error that occurs from above

Error in `stop_subscript()`:
! Can't subset columns that don't exist.
x Column `strata` doesn't exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions