Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Walk=TRUE bug #17

Closed
Btibert3 opened this issue Dec 23, 2015 · 2 comments
Closed

Walk=TRUE bug #17

Btibert3 opened this issue Dec 23, 2015 · 2 comments
Assignees

Comments

@Btibert3
Copy link
Contributor

I believe there is a bug when walk=FALSE is set. The error check simply needs to be moved inside the parent {.

The issue:

options(stringsAsFactors=F)

## library
library(stattleshipR)
library(dplyr)

## set the token
set_token(Sys.getenv("STATTLE_TOKEN"))

goals3 <- ss_get_result(ep="total_stats", query=list(type="hockey_team_stat",
                                                     stat="goals_period_3",
                                                     team_id="nhl-bos"),
                        walk = FALSE)

returns

[1] "Making initial API request"
Error in stopifnot(length(response) == pages) : object 'pages' not found
@Btibert3 Btibert3 self-assigned this Dec 23, 2015
@Btibert3
Copy link
Contributor Author

The https://github.com/stattleship/stattleship-r/tree/brock-issue17 makes the change.

goals3 <- ss_get_result(ep="total_stats", query=list(type="hockey_team_stat",
                                                     stat="goals_period_3",
                                                     team_id="nhl-bos"),
                        walk = FALSE)

yields

> goals3[[1]]$total_team_stat
$stat
[1] "goals_period_3"

$total
[1] 33

$team_id
[1] "e9d7bcb5-6723-4ca9-b1d9-1ccd026be1cb"

It's curious why the result is not a dataframe, but that needs to be explored further and may be resolved on the completion of #7.

@tcash21
Copy link
Contributor

tcash21 commented Jan 4, 2016

Works now, nice work @Btibert3 !

@tcash21 tcash21 closed this as completed Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants