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 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 commented Oct 22, 2012

Hmmm, good question. It uses identical for the test

@jeroen
Copy link
Member Author

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.

@hadley
Copy link
Member

hadley commented Mar 20, 2013

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

@hadley hadley closed this as completed 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
Development

No branches or pull requests

2 participants