Unexpected symbol for plotting ggplot

I don’t know what I have done wrong
ggplot(data = mean_undernourishment) +
geom_point(mappings = aes( x = Year, y = Prevalence of undernourishment (% population))

A variable/column name cannot contain spaces, which is why you get an error as ggplot don't know what to do with a series of words. As your data is loaded in as a data.frame with a column name featuring spaces, you could try putting the variable name in accent signs `:

ggplot(data = meanundernourisment) +
   geom_point(mapping = aes(x = `Year`, y = `Prevalence of undernourishment (% of population)`)

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