Skip to content

Commit

Permalink
changed round to Sys.Date() >= MaxGameStartDate in vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
FlavioLeccese92 committed Mar 5, 2024
1 parent c7286c8 commit 6b579a9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions vignettes/articles/team-goals-by-time.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ date: "`r Sys.Date()`"
output: html_document
---

```{r markdown-set, include=FALSE}
```{r markdown-set, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE,
message = FALSE,
Expand Down Expand Up @@ -62,7 +62,7 @@ showtext_auto()

```{r data}
CompetitionRounds <- getCompetitionRounds("E2023") %>%
filter(MinGameStartDate <= Sys.Date())
filter(Sys.Date() >= MaxGameStartDate)
MaxRound <- max(CompetitionRounds$Round)
MaxGameDate <- format(as.Date(max(CompetitionRounds$MaxGameStartDate)),
Expand Down Expand Up @@ -119,7 +119,7 @@ PlayByPlay = PlayByPlay %>%
mutate(TeamName = factor(TeamName, levels = unique(.$TeamName)))
Points = PlayByPlay %>%
Goals = PlayByPlay %>%
filter(PlayType %in% c("2PM", "3PM", "2PA", "3PA"),
ActionMarker < 24,
Chance == 1) %>%
Expand All @@ -138,7 +138,7 @@ Points = PlayByPlay %>%
pivot_longer(cols = c("Missed", "Made"), names_to = "MissedMade", values_to = "Percentage") %>%
mutate(MissedMade = factor(MissedMade, levels = c("Missed", "Made")))
Labels = Points %>%
Labels = Goals %>%
group_by(TeamName, ActionMarker, GoalValue) %>%
mutate(y = sum(Percentage)) %>% ungroup() %>%
filter(MissedMade == "Made") %>%
Expand All @@ -153,7 +153,7 @@ Labels = Points %>%
## Image for plot

```{r images for plot}
TeamImage <- Goals %>%
TeamImage <- PlayByPlay %>%
filter(!is.na(TeamImagesCrest)) %>%
distinct(TeamName, TeamImagesCrest) %>%
mutate(x = 1, y = 1.05)
Expand Down Expand Up @@ -186,7 +186,7 @@ PlotCaption <- glue(

```{r plot}
# Initialize
e <- Points %>%
e <- Goals %>%
ggplot(aes(x = as.numeric(ActionMarker)))
# Draw bars of stats
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/team-standings-race.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ showtext_auto()

```{r data}
CompetitionRounds <- getCompetitionRounds("E2023") %>%
filter(MinGameStartDate <= Sys.Date())
filter(Sys.Date() >= MaxGameStartDate)
CompetitionStandings <- getCompetitionStandings("E2023", CompetitionRounds$Round)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/team-stats-court.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ showtext_auto()

```{r data}
CompetitionRounds <- getCompetitionRounds("E2023") %>%
filter(MinGameStartDate <= Sys.Date())
filter(Sys.Date() >= MaxGameStartDate)
MaxRound <- max(CompetitionRounds$Round)
MaxGameDate <- format(as.Date(max(CompetitionRounds$MaxGameStartDate)),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/team-stats-radar.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ showtext_auto()

```{r data}
CompetitionRounds <- getCompetitionRounds("E2023") %>%
filter(MinGameStartDate <= Sys.Date()) %>%
filter(Sys.Date() >= MaxGameStartDate) %>%
slice_head(n = 1)
MaxRound <- max(CompetitionRounds$Round)
Expand Down

0 comments on commit 6b579a9

Please sign in to comment.