scatterpie icon indicating copy to clipboard operation
scatterpie copied to clipboard

Cannot plot categorical data

Open wcerfgba opened this issue 3 years ago • 0 comments

Hello,

I am trying to use scatterpie with categorical x and y variables but I get the following error when I try:

Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : 
  non-numeric argument to binary operator

Here is a minimal reproducible example:

data <- data.frame(
  x = sample(c('a', 'b', 'c'), 10, replace = TRUE),
  y = sample(c('t', 'u', 'v'), 10, replace = TRUE),
  m = rnorm(10),
  n = rnorm(10)
)
ggplot() +
  geom_scatterpie(
    aes(
      x = x,
      y = y
    ),
    data = data,
    cols = c(m, n)
  )

I have seen two other issues about this (#2 and #13) but I don't see any example in the vignette: all examples in the vignette are continuous lat and long x/y.

Thanks!

wcerfgba avatar Jan 25 '22 15:01 wcerfgba