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?
Thanks!

1 Like

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

https://forum.posit.co/t/faq-draft-tips-for-writing-r-related-questions/47267

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))))

library(ggplot2)
# 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")

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.