Skip to content

expect_equivalent() for categorical data #528

@AmeliaMN

Description

@AmeliaMN

I know you are using base functions like all.equal() to do the underlying checks, but it would be nice to have a way to check levels in factor variables without getting the ordering precisely right. See https://github.com/dsscollection/factor-mgmt/blob/master/analysis/working_with_factors.Rnw#L394 for an example of what I'm talking about. In essence, I wish that I could run

expect_equivalent(c("Male", "Female"), c("Female", "Male")) 

and get a TRUE.
Maybe this is something more appropriate for https://github.com/hadley/forcats ?

cc @nicholasjhorton

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions