Error when creating ggplot

Does anyone know why I get this error when creating the ggplot for the train data set? ggplot(train, aes(x = Pclass, fill = Survived))+geom_histogram(width = 0.5) + xlab(“Pclass”)+ylab(“Total Count”)+labs(fill = “survived”) Error: StatBin requires a continuous x variable the x variable is discrete. Perhaps you want stat=”count”?


Link to Full Article: Error when creating ggplot

Pin It on Pinterest

Share This