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
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
all.equal()
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
The text was updated successfully, but these errors were encountered:
I would think that:
should return TRUE but
expect_equal(c("Male", "Female"), c("Female", "Male"))
should return FALSE
On Sep 15, 2016, at 2:45 PM, Amelia McNamara notifications@github.com wrote: 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 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
On Sep 15, 2016, at 2:45 PM, Amelia McNamara notifications@github.com wrote:
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Nicholas Horton Professor of Statistics Department of Mathematics and Statistics, Amherst College PO Box 5000, AC #2239 Amherst, MA 01002-5000
Sorry, something went wrong.
Maybe expect_setequal() that would use setequal() under the hood?
expect_setequal()
setequal()
I'm unlikely to implement this myself, but I'd be happy to review a PR.
e3880d6
No branches or pull requests
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 runand get a TRUE.
Maybe this is something more appropriate for https://github.com/hadley/forcats ?
cc @nicholasjhorton
The text was updated successfully, but these errors were encountered: