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

use is.object(x) instead of grepl("OBJ", .Internal(inspect(x))[1]) in tests #83

Open
BillDunlap opened this issue Feb 28, 2018 · 0 comments

Comments

@BillDunlap
Copy link

reshape2/tests/testthat/test-melt.R uses an illegal-on-CRAN .Internal(inspect(x)) along with some ugliness to see if an item is an S4 object:

object_bit_set <- function(x) {
grepl("\[OBJ", capture.output(.Internal(inspect(x)))[1])
}
t.long <- melt(t.wide, measure.vars=c("t1", "t2", "t3"), value.name="time")
expect_true(object_bit_set(t.long$time))

I believe object_bit_set(x) is equivalent to is.object(x) and is.object is a core R function.

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

1 participant