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

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

Merged
merged 1 commit into from May 30, 2016

Conversation

@lionel-
Copy link
Member

@lionel- 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.

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"))) {
Copy link
Member

@hadley hadley May 30, 2016

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

@hadley
Copy link
Member

@hadley 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
@hadley
Copy link
Member

@hadley 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.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants