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

Relax type checking of numeric objects in labelled() #110

Merged
merged 1 commit into from May 30, 2016

Conversation

Projects
None yet
2 participants
@lionel-
Copy link
Member

lionel- commented Sep 28, 2015

This fixes a range of errors due to labels and values having mixed integer/double types. One example where this occurs is when importing the ANES datasets in DTA format.

In particular this caused the [.labelled method to fail, and also print.tbl_df() as a remote consequence.

Relax type checking of numeric objects in labelled()
This fixes a range of errors occurring when labels and values had
mixed integer/double types.
return(TRUE)
}

if (all(c(typeof(x), typeof(labels)) %in% c("integer", "double"))) {

This comment has been minimized.

@hadley

hadley May 30, 2016

Member

Maybe just if is.numeric(x) && is.numeric(labels) ?

@hadley

This comment has been minimized.

Copy link
Member

hadley commented May 30, 2016

And could you please add a bullet to NEWS?

@hadley hadley merged commit e2bf6d5 into tidyverse:master May 30, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hadley

This comment has been minimized.

Copy link
Member

hadley commented May 30, 2016

Don't worry, did it myself :)

@lock lock bot locked and limited conversation to collaborators Jun 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.