Comments (18)
So, it used to be there, but looking at the url structure they changed it--basically because there are a ton more fields available. So, yes, but I'll need to update the url and subsequent formatting used in the function.
from baseballr.
Perfect. Is the pitcher leaderboard scrape coming soon?
from baseballr.
playerid
will be added in the next package update. No plans right now for the pitcher leader board, but if someone wanted to tackle it in a pull request that would be groovy.
from baseballr.
Did the fgid make it into this package?
from baseballr.
Yes
from baseballr.
I didn't see it when I ran it, and also didn't see it in the code. Not sure if I did something wrong on my end.
from baseballr.
It was there when I tested it. I’ll double check later.
from baseballr.
Any updates on this bug?
from baseballr.
Any updates on the bug. I just ran the function and didn't get the id.
from baseballr.
Unfortunately, this is not so much a bug as an enhancement. The data needs to pull retrieved in a different way to get the playerid
returned with the leaderboards. I have not worked out an approach yet.
from baseballr.
So looking this over, I should be able to extract playerid
from the url for each player from the html of the page. Just need to find some time to do it.
from baseballr.
That would be very cool. Unfortunately my programming skills aren't nearly as good as yours or I would offer to help.
from baseballr.
Without doing a full fork, and PR, how about something like?
find_possible_playerids <- leaders %>% html_nodes("a") %>% as.character()
find_playerids <- find_possible_playerids[grep("statss.aspx\\?playerid=", find_possible_playerids)]
find_playerids_split <- strsplit(find_playerids, "\\&") %>% sapply(., "[", 1)
fangraphs_pg_playerids <- gsub("[[:alpha:]]*[[:punct:]]*[[:space:]]*", "", find_playerids_split)
from baseballr.
This should be fixed now with the latest commit. Give it a reinstall and let me know if it brakes.
from baseballr.
I just reinstalled and tested it but didn't get the playerid field. I reinstalled using,
devtools::install_github("BillPetti/baseballr")
from baseballr.
Check and make sure your function’s content includes the new playerid
code. You may need to force the install to get the updated version, install_github(“BillPetti/baseballr”, force = TRUE)
.
from baseballr.
Great, I got it working, everything looks good.
Separate question. Is there anyway to get a playid for the following function. daily_batter_bref() ? We get the names but it's difficult to match the names to an MLBID.
Cheers,
from baseballr.
Probably, but please open a separate issue for it.
from baseballr.
Related Issues (20)
- Better Documentation Around Fangraphs "Month" Parameter HOT 1
- When is Statcast PBP Data For Prev Day Games Available?
- Possible to update the data returned by load_umpire_ids()?
- Add fielding to ncaa_team_player_stats
- Name/Column Assignment HOT 1
- Scrape_savant_batter_all assigned name issue HOT 1
- Statcast Search (scrape_statcast_savant) Error: Can't assign 92 names to a 94-column data.table HOT 2
- statcast_search error: "Can't assign 92 names to a 94 column data.table" HOT 5
- ncaa_game_logs not working for type = "pitching" HOT 2
- statcast_search has broken due to batspeed and swing length being added HOT 16
- Do any of the functions in this package return the player height, weight, nationality, etc.? HOT 1
- additional request regarding statcast-search-minors
- statcast_search pitcher error: Error in setnames(x, value) Can't assign 92 names to a 94 column data.table HOT 1
- `ncaa_teams` function returns `NA` for every `team_id` HOT 1
- ncaa_team_player_stats() no Height & Handedness columns
- fg_pitcher_leaders HOT 5
- Rate limit issue with "bref_standings_on_date"
- load_umpire_ids() HOT 1
- statcast_search_batters returns Error: Can't assign 94 names to a 112-column data.table HOT 4
- fg_batter_leaders HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baseballr.