"Invalid arguments or no team results available" for MIA, WSN, LAD, CLE, CHA for 2022
Opened this issue · 4 comments
Forrest31 commented
Describe the bug
No results for 5 teams using the bref_team_results function.: Marlins, Nats, Dodgers, Guardians, and White Sox.
To Reproduce
The following code provides results for only 25 teams. The teams listed above
teams<-c("NYM", "CHC", "ATL", "CIN", "SLN", "LAA", "BAL", "MIN",
"OAK", "TEX", "TOR", "ARI", "PIT", "SEA", "HOU", "KCR", "TBR",
"COL", "MIL", "PHI", "SDN", "SFN", "BOS", "DET", "NYA","LAD",
"CHA", "CLE", "WSN", "MIA")
```{r For Loop for 2022 Season Results}
mlb_results<-data.frame()
for (x in teams) {
season_results<-bref_team_results(Tm=x, year = 2022)
loop<-data.frame(season_results)
mlb_results<-rbind(mlb_results,loop)
}
2023-03-14 09:58:53: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:54: Invalid arguments or no team results data available!
2023-03-14 09:58:55: Invalid arguments or no team results data available!
2023-03-14 09:58:55: Invalid arguments or no team results data available!
2023-03-14 09:58:55: Invalid arguments or no team results data available!
2023-03-14 09:58:55: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:56: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:57: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:58: Invalid arguments or no team results data available!
2023-03-14 09:58:59: Invalid arguments or no team results data available!
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: windows
- Browser [e.g. chrome, safari]
- Version R version 4.2.2, baseballr package 1.3.0
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
camdenk commented
My guess is Baseball Reference might've rate limited your requests.
I ran this below without any issues.
library(tidyverse)
library(baseballr)
teams<-c("NYM", "CHC", "ATL", "CIN", "SLN", "LAA", "BAL", "MIN",
"OAK", "TEX", "TOR", "ARI", "PIT", "SEA", "HOU", "KCR", "TBR",
"COL", "MIL", "PHI", "SDN", "SFN", "BOS", "DET", "NYA","LAD",
"CHA", "CLE", "WSN", "MIA")
mlb_results<-data.frame()
for (x in teams) {
Sys.sleep(runif(1, max = 7))
print(x)
season_results<-bref_team_results(Tm=x, year = 2022)
loop<-data.frame(season_results)
mlb_results<-rbind(mlb_results,loop)
}
Forrest31 commented
Thank you for responding so quickly. I really appreciate it.
Do you happen to have contact information for anyone at baseball reference
to increase my limit or know how I could increase this? Thank you so much.
…On Wed, Mar 15, 2023 at 3:35 PM Camden Kay ***@***.***> wrote:
My guess is Baseball Reference might've rate limited your requests.
I ran this below without any issues.
library(tidyverse)
library(baseballr)
teams<-c("NYM", "CHC", "ATL", "CIN", "SLN", "LAA", "BAL", "MIN",
"OAK", "TEX", "TOR", "ARI", "PIT", "SEA", "HOU", "KCR", "TBR",
"COL", "MIL", "PHI", "SDN", "SFN", "BOS", "DET", "NYA","LAD",
"CHA", "CLE", "WSN", "MIA")
mlb_results<-data.frame()
for (x in teams) {
Sys.sleep(runif(1, max = 7))
print(x)
season_results<-bref_team_results(Tm=x, year = 2022)
loop<-data.frame(season_results)
mlb_results<-rbind(mlb_results,loop)
}
—
Reply to this email directly, view it on GitHub
<#292 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTITNU5MESPQEC5PJ73VZDW4IR2RANCNFSM6AAAAAAV2SBRJM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
camdenk commented
I think it was likely a temporary limitation. Have you tried updating the package and then running the example that I included to see if that works for you?
Forrest31 commented
No. I assumed the limitation was forever. I can try that now. Thank you.
…On Tue, Mar 21, 2023 at 10:29 AM Camden Kay ***@***.***> wrote:
I think it was likely a temporary limitation. Have you tried updating the
package and then running the example that I included to see if that works
for you?
—
Reply to this email directly, view it on GitHub
<#292 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTITNQYEQ64PWDNPSSPBHTW5HCM5ANCNFSM6AAAAAAV2SBRJM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>