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

makeDisplay() lims don't seem to work for a panel function written in base R #83

Open
lhsego opened this issue Feb 11, 2015 · 2 comments

Comments

@lhsego
Copy link
Member

lhsego commented Feb 11, 2015

See this example. It runs without error or warning--but the xlims and ylims are not fixed.

library(trelliscope)
vdbConn("iris_test", name = "iris_test", autoYes = TRUE)
by_species <- divide(iris, by = "Species", update = TRUE)
makeDisplay(by_species,
            name ="iris",
            panelFn = function(x) {plot(x$Sepal.Length, x$Petal.Width); return(NULL)},
            cogFn = function(x) list(Sepal.Width.Mean = cogMean(x$Sepal.Width)),
            lims = list(x = "same", y = "same",
                        prepanelFn = function(x) list(xlim = range(x$Sepal.Length),
                                                      ylim = range(x$Petal.Width))))
view()
@hafen
Copy link
Contributor

hafen commented Feb 11, 2015

Oh good point - it should give a message that it isn't doing anything with limits and that you will need to specify them manually. This is described in the docs somewhere but should be a message too if attempted. There's no way to set the limits in this case unless the user does it manually because we don't have an object to modify. Another strike against base graphics :). Would you like to make this fix? Basically in makeDisplay(), just look at where the panelFn type is found and if it is base, if lims are not free then give a message of "Ignoring 'lims' since panel function is base R graphics" or something like that.

@lhsego
Copy link
Member Author

lhsego commented Feb 11, 2015

Sure, I can do that.

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