PalmerPenguins_facet(~species) does not segregate the datapoints as per species

install.packages("palmerpenguins")
library(ggplot2)
library(palmerpenguins)
ggplot(data=penguins)+geom_point(mapping=aes(x=flipper_length_mm,y= body_mass_g,color=species))
+facet_wrap(~species)

the positioning of + operator is important when using ggplot (similar rules as to the magrittr pipe %>%)
for the statements to be connected the + should have content to the left of it.
Your code has a line starting with + so it doesnt connect.
try

ggplot(data=penguins)+
  geom_point(mapping=aes(x=flipper_length_mm,
                         y= body_mass_g,
                         color=species)) +
  facet_wrap(~species)

Thanks so much. I got it now :grinning:

This topic was automatically closed 7 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.