hexbin icon indicating copy to clipboard operation
hexbin copied to clipboard

Using groups leads to error about missing subscripts

Open HVinther opened this issue 5 months ago • 7 comments

Running hexbinplot(Sepal.Length ~ Sepal.Width,data = iris,groups = Species) leads to the following error Image

Expected grouped plot similar to lattice::xyplot,

xyplot(Sepal.Length ~ Sepal.Width,data = iris,groups = Species)

Image``

I'm using lattice 0.22-6, hexbin 1.28.5 and R 4.5.0.

HVinther avatar Jul 14 '25 13:07 HVinther

Try

hexbinplot(Sepal.Length ~ Sepal.Width,data = iris)

edzer avatar Jul 14 '25 13:07 edzer

I can run hexbinplot without a grouping variable without error.

HVinther avatar Jul 15 '25 06:07 HVinther

Note, this is still and issue, as using the group argument still leads to an error.

This does not address the issue.

Try

hexbinplot(Sepal.Length ~ Sepal.Width,data = iris)

HVinther avatar Jul 15 '25 07:07 HVinther

The question is what you had expected, and whether this error is to be expected or not. Did this work in the past? What plot should come out? Given groups= leads to colored symbols, should the hexagons become colored and if yes how, since hexagon colors should denote counts? Have you tried a conditioning plot like this?

hexbinplot(Sepal.Length ~ Sepal.Width|Species,data = iris)

edzer avatar Jul 15 '25 07:07 edzer

As groups is listed as an argument, I would at least expect the function not to cause an error, when it is used as indicated in the documentation.

Image

HVinther avatar Jul 15 '25 07:07 HVinther

From the documentation I would expect the argument to result in a grouped version of the standard plot, perhaps some like this:

Image

HVinther avatar Jul 15 '25 07:07 HVinther

If this argument is not intended for use, perhaps the help page should state this, and the function could give an insight full error message, if it is called with the argument regardless.

HVinther avatar Jul 15 '25 07:07 HVinther