Why isn't it working?

hello can anyone help me with the following problem?

I want a line of graphic. I want the horizontal line to be the year.
I want different lines with different genres.
I want to know which genre scores best on which year

I really hope someone can help me with this problem.
Below I have made an outline of the code.

I only get an error:
Error in FUN (X [[i]], ...): object 'EU_Sales' not found

And I do not understand why he indicates this error message
Jaar <- videogames %>%
filter(Platform %in% c("NES", "SNES" , "N64", "Wii", "WiiU", "GB", "GBA", "GC", "3DS", "DS", "3DS")) %>%
group_by(Platform, Year, EU_Sales) %>%
summarize(total = sum(EU_Sales))
#kolomen maken met alleen jaar/platform/EU_salas

Jaar %>%
group_by(Platform, Year) %>%
summarize(total = sum( EU_Sales)) %>%
ggplot(aes(x = Year, y = EU_Sales)) +
geom_point(alpha = 0.5, pch = 21) +
geom_point(data = Jaar, aes(col = Platform), size = 1.5) +
geom_line(data = Jaar, aes(col = Platform), size = 1.3) +
scale_color_viridis(discrete = TRUE) +
theme(legend.position = c(0.2, 0.7)) +
labs(title = "Verkoop over de Jaren", y = "Europa Sales")

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Hard to tell without a reprex/example data but this seems like an incorrect column reference. Try calling str() or colnames() on your data and double-checking that you have "EU_Sales" spelled/formatted correctly.

is did a repress?

i did not spell it wrong, i dubbel check it

Check the link in andresrcs' post for a guide/explanation. The short version is that there's a special package you install that will generate a clean/easy to paste reprex, as long as you follow the guidelines for what is needed. It's hard/impossible to diagnose a problem like what you're having without some example data/other items. For example, you said that you double-checked the spelling/format of "EU_Sales" but you haven't posted anything that would let someone else double-check you on that. You might have done something minor(inconsistent casing, period instead of an underscore, etc.) that someone else might pick up on.

It doesn't make sense to both group by eu sales and summarise by it. Suggest you remove it from the group by
Also if you summarise it while making jaar then you won't need to summarise jaar again

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