I'm looking for a solution to the following scenario.
I have two data frames in R - one with a list of teams and the other with individual player statistics. I'm looking to merge information from both sources into a book format which will list the results for one team/season per page, in chronological order.
Will Markdown and/or Bookdown allow me to:
- select a team from a list of franchises and post the team results near the top of each page in a fixed location.
- overlay data specific to player/positions on a field diagram based on their statistics from a given year. The field diagram needs to repeat in the same location on every page and the player data needs to float above the diagram in designated areas. (for example, the top three to five players at each position).
- below the field diagram (starting around the mid-section of the page), another report will display individual player stats for the entire team roster (if there is enough space, otherwise truncate after X rows). Each page will display results from a specific year, in chronological order.
To clarify, let's say I want to filter on the "New York" franchise. My "Teams" data source contains a row for every year that the New York franchise existed, including the team's won-loss record, league rank (where it finished in the standings), etc. The key field in both data sources contains the franchise ID along with the year (such as NY_1998, NY_1999, etc.). So I need to know if I can filter "New York" and have the report display both the team and individual data for each season in chronological order. Also key to the project is the ability for the results to be positioned exactly in the same location on every page.