Skip to content

Commit

Permalink
Use historical team roster in vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
k5cents committed May 3, 2024
1 parent 5afdea6 commit e5424ca
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
6 changes: 4 additions & 2 deletions R/roster.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ out_roster <- function(entry, tid, tm, wk, yr, es = FALSE) {
#' @param roster A roster data frame from [team_roster()].
#' @return A data frame of starters on a roster.
#' @examples
#' start_roster(team_roster(leagueId = "42654852")[[1]])
#' rost <- team_roster(leagueId = "42654852", leagueHistory = TRUE)[[1]][[1]]
#' start_roster(rost)
#' @family roster functions
#' @export
start_roster <- function(roster) {
Expand All @@ -152,7 +153,8 @@ start_roster <- function(roster) {
#' @param useScore One of "projectedScore" or "actualScore" (default).
#' @return A starting score as double.
#' @examples
#' roster_score(team_roster(leagueId = "42654852")[[1]])
#' rost <- team_roster(leagueId = "42654852", leagueHistory = TRUE)[[1]][[1]]
#' roster_score(rost)
#' @family roster functions
#' @export
roster_score <- function(roster,
Expand Down
4 changes: 0 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ contributing, you agree to abide by its terms.
[cov_badge]: https://codecov.io/gh/k5cents/fflr/graph/badge.svg?token=CMz6DIxJdH
[cov_link]: https://app.codecov.io/gh/k5cents/fflr?branch=master
[dl_badge]: https://cranlogs.r-pkg.org/badges/grand-total/fflr
<<<<<<< HEAD
[api]: https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/
[iss]: https://github.com/kiernann/fflr/issues
=======
[api]: https://fantasy.espn.com/apis/v3/games/ffl/
[iss]: https://github.com/k5cents/fflr/issues
>>>>>>> 51d8f8313cb57960ba168ad9b476f2d226482453
[cran]: https://cran.r-project.org/package=fflr
Expand Down
3 changes: 2 additions & 1 deletion man/roster_score.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/start_roster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions tests/testthat/test-live.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
test_that("live scoring returns 1 row per team", {
<<<<<<< HEAD
l <- live_scoring(leagueId = "42654852", yetToPlay = TRUE, bonusWin = TRUE)
skip_empty(l)
=======
l <- live_scoring(leagueId = "42654852", yetToPlay = FALSE, bonusWin = TRUE)
>>>>>>> 51d8f8313cb57960ba168ad9b476f2d226482453
expect_s3_class(l, "data.frame")
# expect_true("toPlay" %in% names(l))
expect_length(l, 7)
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/test-outlook.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ test_that("get individual player outlook", {
limit = 1
)
expect_s3_class(o, "data.frame")
<<<<<<< HEAD
expect_length(o, 5)
=======
if (is.na(o$outlook)) {
expect_length(o, 5)
} else {
expect_length(o, 6)
}
>>>>>>> 51d8f8313cb57960ba168ad9b476f2d226482453
})
4 changes: 2 additions & 2 deletions vignettes/fantasy-football.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ website. Players are listed in order of their "slot" with name and team
information followed by projected and actual scores and ownership statistics.

```{r team-roster}
my_team <- team_roster(scoringPeriodId = 1)[[1]] # select first roster
my_team[, -(1:3)]
my_team <- team_roster(scoringPeriodId = 1, leagueHistory = TRUE)[[1]] # select first roster
my_team[[1]][, -(1:3)]
```

### News
Expand Down

0 comments on commit e5424ca

Please sign in to comment.