PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / trunk
Code Block Pro – Beautiful Syntax Highlighting vtrunk
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / r.sample

r.sample in Code Block Pro – Beautiful Syntax Highlighting trunk, at build/shiki/samples/r.sample

22 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 Year.Release <- game$Year.Release
2 counts <- data.frame(table(Year.Release))
3 p <- game %>%
4 select(Year.Release, Global.Sales) %>%
5 group_by(Year.Release) %>%
6 summarise(Total.Sales = sum(Global.Sales))
7 q <- cbind.data.frame(p, counts[2]) # Add counts to data frame
8 names(q)[3] <- "count"
9 q$count <- as.numeric(q$count)
10
11 ggplot(q, aes(x = Year.Release, y = Total.Sales, label = q$count)) +
12 geom_col(fill = "green") +
13 geom_point(y = q$count * 500000, size = 3, shape = 21, fill = "Yellow" ) +
14 geom_text(y = (q$count + 50) * 500000) + # Position of the text: count of games each year
15 theme(axis.text.x = element_text(angle = 90),
16 panel.background = element_rect(fill = "purple"),
17 panel.grid.major = element_blank(),
18 panel.grid.minor = element_blank()) +
19 scale_x_discrete("Year.Release", labels = as.character(Year.Release), breaks = Year.Release)
20
21 # From https://gexijin.github.io/learnR/the-game-sales-dataset.html#analysis-of-sales
22