Code Monkey home page Code Monkey logo

nbar's People

Contributors

patrickchodowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nbar's Issues

More integer conversions causing data to return all 0's

Conversions from double to integer causing all data in player season usage tables (get_general("player", measure_type = "usage") ) to return all 0's . If I may , I would probably suggest to just let it return numbers as double and remove the integer conversions and leave it up to the users to convert on the front end if they wish. It would just save you a great deal of headaches.

Otherwise, still loving the package! By far the best NBA api wrapper in R.

Automatic conversion of stats from numeric to integer is causing loss of data

Amazing package. But I noticed the package automatically converts numbers to integers dropping the decimal points, which is making working with averages sort of tricky and also causing many variables (ex PIE and Freq) to appear as 0, especially with single digit percentages. For example, team shotclock FG Freq is 4%, but stored as 0.04 in the raw data is converting it to 0.

errors from functions I've tried include `get_tracking` and `get_all_tracking` - errors due to `check_if_numeric`

When I run the functions get_tracking or get_all_tracking I'm returned the error [1] "Can't convert `replace` <double> to match type of `data` <character>." The problem stems from the internal call to check_if_numeric.

Here's code to make this reproducible.

library(NBAr)
get_tracking(season = 2023, type = "Player", measure_type = "Passing", 
             date_from = "02/07/2024", date_to = "02/07/2024")

When the function encounters a column that is all character data (e.g., player names) you'll get an error here, instead of a warning, due to the way it's used.

I would be remiss not to mention that mutate_if is deprecated, as well.

Although I did not explore all the ways this function is used, I was curious as to why type.convert() from the R utlils package wasn't used instead. (There may be a very good reason for that!)

I didn't do anything that I would consider a thorough examination, but using type.convert worked for me.

df3 <- data.frame(a = c("10", NA, 4), b = LETTERS[1:3], c = c(29, "2", 1)) %>% type.convert(as.is = T)
> lapply(df3, typeof)
$a
[1] "integer"

$b
[1] "character"

$c
[1] "integer"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.