I have a vector of matchIds and a function that returns the players who played in that match as a vector (say getPlayersFromMatchId is the function). Now my question is, what is the most idiomatic way of iterating over the matchIds, extracting the player info and building a data frame where each row corresponds to the players who played in that match? Here's a simple for loop that does the trick
for (match in matchIds){
players = getPlayersFromMatchId(match)
Add players to a dataframe
}
I can iterate over the matchIds but how do I build the data frame with each value returned by the function?