A Litle help with the code


I want to change this code, but I can't quite do it.

vd = game%>% select (Genre, Year)
require (plyr)
vd = ddply (vd,. (Genre, Year), transform, count = length (Genre))
vd = unique (vd)
detach ('package: plyr', TRUE)
ggplot (vd, aes (Year, count, group = 1, color = Genre)) + geom_line (size = 2) + theme (axis.text.x = element_text (angle = 90, vjust = 0.3), plot.title = element_text (hjust = 0.5, face = 'italic'), legend.position = "none") + ggtitle ("Video game sales through the years") + labs (x = "Year", y = "Count") + facet_wrap ( ~ Genre, scales = 'free_y', ncol = 1)

I only want to show Nintendo consoles in the genres:
"NES", "SNES", "N64", "Wii", "WiiU", "GB", "GBA", "GC", "3DS", "DS", "3DS

But I don't know how, or I can't.

what variable of your dataset contains information on the console ?

"NES", "SNES", "N64", "Wii", "WiiU", "GB", "GBA", "GC", "3DS", "DS", "3DS
Are in "Platform"

vd = game %>%
   filter(Platform %in% c("NES", "SNES", "N64", "Wii", "WiiU", "GB", "GBA", "GC", "3DS", "DS", "3DS")) %>% 
   select (Genre, Year)

unfortunately I still have the same kind of lines with and without the platform of the ninetendo

Down is new

I think you need to be more explicit about what you want.
I helped you filter out non nintendto platforms from your data from which you plotted genre volumes by year
but you want to see something different, ... what ...
do you want to plot platforms instead of genres ?

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.