In my data, each player has data over 3 days. Within each of those days, a player can produce anywhere from 1 to 35 songs. I would like to create a line graph (for for each player), representing both the number of songs AND days on the X axis, and the cash related to each of those points on the Y axis. This is similar but different from this great question here. because the number of songs is not consistent across the days.
here is a sample of my data:
data.sample <- read_table2('player song.seq day cash
1 1 1 65
1 2 1 65
1 3 1 54
1 4 1 56
1 5 1 34
1 6 1 768
1 7 1 611
1 8 1 750
1 9 1 888
1 1 2 1027
1 2 2 1166
1 3 2 1304
1 4 2 1443
1 5 2 1581
1 6 2 1720
1 7 2 1859
1 8 2 1997
1 1 3 2136
1 2 3 2274
1 3 3 2413
1 4 3 2552
1 5 3 2690
2 1 1 2829
2 2 1 2967
2 3 1 3106
2 4 1 3245
2 5 1 3383
2 6 1 3522
2 7 1 3660
2 8 1 3799
2 9 1 3938
2 1 2 4076
2 2 2 4215
2 3 2 4353
2 4 2 4492
2 5 2 4631
2 6 2 4769
2 7 2 4908
2 1 3 5046
2 2 3 5185
2 3 3 5324
2 4 3 5462
2 5 3 5601
2 6 3 5739
')
I know that I can do something like this, but it isn't achieving my desired result. Any help would be greatly awesome!
data.sample %>% filter(player=="1") %>% ggplot(aes(x = interaction(song.seq, day, lex.order = TRUE),
y = cash, group = 1)) + theme_bw()