Loop fail / loop don't work

I have been told the i can loop the following code:

1.Action Total_EU_Sales 525

videogames %>%
  filter(Genre == "Action") %>%
  summarise(Total_EU_Sales = sum(EU_Sales))

2.Adventure Total_EU_Sales 64.13

videogames %>%
  filter(Genre == "Adventure") %>%
  summarise(Total_EU_Sales = sum(EU_Sales))

3.Fighting Total_EU_Sales 101.32

videogames %>%
  filter(Genre == "Fighting") %>%
  summarise(Total_EU_Sales = sum(EU_Sales))

But i don't get it how i can loop this thing with using this code:

for (i in 11:67 ) {
  print ( i ^ 2 )
}

Can anyone help me ?

Can you try asking your question a different way, it really doesn't make any sense as its currently written...

Why looping ?

videogames %>% 
  filter(Genre %in% c("Action","Adventure","Fighting")) %>% 
  group_by(Genre) %>% 
  summarise(Total_EU_Salse =  sum(EU_Sales))

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.