0

I am attempting to plot variables from a dataset, but I am getting an error in the last line of code saying that stat_count() can only have an x or y aesthetic.

I am completely lost, please help.

this is my code chunk:

library(patchwork)

plt_srh <- ggplot(Data, aes(x = srh)) +
  geom_density() +
  geom_boxplot(width = 0.001)
  labs(x = 'srh')

plt_location <- ggplot(Data, aes(x = location)) +
                        geom_bar() +
                        labs(x = 'location')

plt_joint <- ggplot(Data, aes(x = location, y = srh)) +
  geom_bar() +
  labs(x = 'location', y = 'srh')

plt_srh | plt_location | plt_joint

maura
  • 1
  • 1
  • 1

0 Answers0