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

Debugging error messages #80

Open
kaneplusplus opened this issue Feb 4, 2015 · 5 comments
Open

Debugging error messages #80

kaneplusplus opened this issue Feb 4, 2015 · 5 comments

Comments

@kaneplusplus
Copy link

Is there a good way to debug error messages that don't show up until interacting with the viewer? I'm getting the following error message only when opening the Table Sort/Filter tab.

Error: argument is of length zero.

The message in the terminal is below.

Error in if (!is.na(curInfo$type)) { : argument is of length zero

I suspect it's a problem with the cognostics I've defined but I'm not positive (the univariate and bivariate filters work fine).

@hafen
Copy link
Contributor

hafen commented Feb 4, 2015

This looks like it's related to an issue I've been meaning to fix for a while. I would guess that in your cognostics function, you did not wrap one or more of your cognostics with cog(). That function simply adds some attributes to your cognostic such as the description, but also infers the cognostics type, which is being checked when this error pops up. This shouldn't be a requirement - it should be done automatically for you if you don't do it, so I need to fix that. But for now, the fix should be to wrap each cognostic with cog(). If you are already doing this and still getting this error then I'll need to dig deeper.

For debugging the viewer, I usually just stick browser statements in the shiny app code, but that isn't a very user-friendly way to do it for others. I'll play around with things like options(error=browser) or options(shiny.error=browser) and see if I can come up with a good recommendation.

@kaneplusplus
Copy link
Author

OK, thanks. FYI, my issue was that one of my cognostics was generating NA's on a corner case.

@hafen
Copy link
Contributor

hafen commented Feb 4, 2015

I see. So every value was NA? I'll need to make checking more robust so these things are handled prior to the viewer.

@kaneplusplus
Copy link
Author

If you source the following cde and click on the Table Sort/Filter tab the error is reproduced.

library(trelliscope)
iris_small = iris[c(1:2, 51:52, 101:102),]
vdbConn("iris_small_test", name="iris_small_test", autoYes=TRUE)
by_species = divide(iris_small, by="Species", update=TRUE)
makeDisplay(by_species,
            name="iris",
            panelFn=function(x) qplot(Sepal.Length, data=x, geom="histogram"),
            cogFn=function(x) list(num_plants=cog(NA, "Plants")))

@hafen
Copy link
Contributor

hafen commented Feb 4, 2015

Thanks!

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