Question Details

No question body available.

Tags

r ggplot2

Answers (1)

July 25, 2026 Score: 2 Rep: 36,351 Quality: Medium Completeness: 80%

geomhdr() needs at least two points per group, however, I'd rather set a higher threshold. The easiest way to get around this would be to split your data and only apply geomhdr() to categories with enough data points.

Here's an example dataset:

set.seed(42)

DF within(Category Warning: Computation failed in stathdr(). #> Caused by error in `if (any(h ! missing value where TRUE/FALSE needed

Then if we split the data, and only apply geomhdr() on the categories that have more than 2 (or more) points, and plot the rest with geompoint() we get the following plot:

min
pts