MacOS: Error in `geom_histogram()` in the First Layer

Hi there,

i am working with datasets from uni and everyone in class with MacBooks get´s the same error. Windows is working just fine with knitting the dataset.

Are there any ideas on how to remove the error? Or an answer on what exactly we have to look at?

1 Like

Hi @neelehoyer , is better put a reproducible example for better understand the error.

You could make histogram with this example:

# Toy data
df <- data.frame(
  Trat=factor(rep(c("T1", "T2"), each=200)),
  weight=round(c(rnorm(200, mean=55, sd=5), 
                                 rnorm(200, mean=65, sd=5))))

# Basic histogram
ggplot(df, aes(x=weight)) + geom_histogram()

# Basic colums
ggplot(df, aes(x=Trat, y=weight)) + geom_col()

y is missing, maybe you need geom_histogram(aes(y = ..density..)) or geom_histogram(stat="count")