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)
- Fangraphs Batter leaders
- Umpire Data from load_umpire_ids() Ends with games 2022-09-07 HOT 2
- bref_standings_on_date no longer functioning HOT 1
- ncaa_park_factor error HOT 1
- Are there any examples of using sit_code successfully?
- ind argument returns error in the fg_pitcher_leaders function HOT 6
- fangraphs defense HOT 2
- add Chadwick helper functions HOT 1
- fg_team_pitcher function does not work HOT 5
- playerid_lookup returning a 404 HOT 3
- Function arent working HOT 3
- baseballr::fg_pitcher_leaders no longer works HOT 1
- fg_batter_game_logs no longer working HOT 6
- package pulled from CRAN HOT 11
- Statcast-Baseballr Potential discrepancy in Barrels values between Savantbaseball web SEARCH and Baseballr scraped data
- fg_pitcher_leaders no longer works
- bref_daily_pitcher() and bref_daily_batter() not working
- Pre-2002 data isn't able to be pulled in with fg_batter_leaders function
- Fangraph batter splits using 'month'
- fg_batter_leaders splits using 'month' argument
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.