具有数据框的结果:
dframe <- structure(list(stock = c("Google, Yahoo", "Google", "Google, Yahoo",
"Google, Yahoo", "Amazon, Google", "Amazon, Google", "Amazon, Google"
), investor = c("Nathalie", "George", "Nathalie", "George", "Melanie",
"George", "Melanie"), year = c("2017", "2018", "2017", "2017",
"2018", "2018", "2017"), n = c(2L, 1L, 2L, 1L, 1L, 1L, 1L)), class = c("tbl_df",
"tbl", "data.frame"), row.names = c(NA, -7L))
# A tibble: 7 x 4 stock investor year n <chr> <chr> <chr> <int> 1 Google, Yahoo Nathalie 2017 2 2 Google George 2018 1 3 Google, Yahoo Nathalie 2017 2 4 Google, Yahoo George 2017 1 5 Amazon, Google Melanie 2018 1 6 Amazon, Google George 2018 1 7 Amazon, Google Melanie 2017 1
有没有一种友好的方法可以生成时间演变图(年列),该图将显示成对的股票投资人列的频率(第n列)?