Skip to content

stat_count gives cryptic error when used on a column of doubles #4609

Closed
@arencambre

Description

@arencambre

Run this trivial code (csv is attached):

library(tidyverse)

data <- read_csv("data.csv")

data %>%
  ggplot(aes(x=Tenure)) +
  geom_bar()

You get this warning:

Warning message:
Computation failed in `stat_count()`:
Elements must equal the number of rows or 1 

This is the resulting plot:
image

The data:
data.csv

Expected behavior: it should "just work". All the data in this tibble is just doubles. I reviewed the geom_bar documentation, and I see no contraindications for this working.

If I have done something wrong here, then this becomes a feature request for a useful error message or improved documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions