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

named vectors #49

Closed
jeroen opened this issue Oct 22, 2012 · 3 comments
Closed

named vectors #49

jeroen opened this issue Oct 22, 2012 · 3 comments

Comments

@jeroen
Copy link
Member

@jeroen jeroen commented Oct 22, 2012

Is this intended behavior?

> (x <- unlist(list(foo=TRUE)))
 foo 
TRUE 
> expect_true(x)
Error: x isn't true
@hadley
Copy link
Member

@hadley hadley commented Oct 22, 2012

Hmmm, good question. It uses identical for the test

Loading

@jeroen
Copy link
Member Author

@jeroen jeroen commented Oct 22, 2012

Maybe use identical(unname(x), TRUE) or something?

R likes to carry around names, but that won't affect the meaning of a TRUE I guess.

Loading

@hadley
Copy link
Member

@hadley hadley commented Mar 20, 2013

Maybe identical(as.vector(x), TRUE)? That will strip all attributes.

Loading

@hadley hadley closed this in b5aec72 Mar 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants