Giter Site home page Giter Site logo

Comments (4)

Enchufa2 avatar Enchufa2 commented on August 19, 2024 1

If these downloads are not small, an improvement would be to cache them for the current session under R's temporary directory. In this way, it would be easier to enable an option so that the user can specify a permanent cache directory.

Alternatively, tools::R_user_dir returns an appropriate directory in every platform to cache data permanently. This is essentially the same functionality as the rappdirs package provides, which was ported to R.

from nfl4th.

guga31bb avatar guga31bb commented on August 19, 2024

Yes, I realize this is annoying, sorry. The reason for this is that CRAN has a very strict package size limit that the models included in nfl4th exceed, so the package has to load these models externally and there's no way to make it work without internet connectivity.

An option for not using the package itself is just getting the pre-computed data here.

from nfl4th.

Enchufa2 avatar Enchufa2 commented on August 19, 2024

Yes, I know the CRAN policy. My suggestion would be to provide a function that the user needs to call in order to download that data and place it under the user dir, instead of doing that on package load. But yet again, that's a suggestion. :)

The reason for this request is that I have an RPM repository for Fedora with all (most) CRAN packages and this one cannot be built due to this issue. For now, I had to remove nfl4th and nflverse (which depends on nfl4th) for now.

If you decide to address this, please let me know to add them back.

from nfl4th.

mrcaseb avatar mrcaseb commented on August 19, 2024

Instead of loading the files on load we could add something like this to the package and call it from inside the other functions

init_nfl4th <- function() {
  pkg_env <- ls("package:nfl4th")
  
  if (!".games_nfl4th" %in% pkg_env){
    .games_nfl4th <- get_games_file()
    assign(".games_nfl4th", .games_nfl4th, envir = parent.env(environment()))
  }
  
  if (!"fd_model" %in% pkg_env){
    fd_model <- load_fd_model()
    assign("fd_model", fd_model, envir = parent.env(environment()))
  }
}

from nfl4th.

Related Issues (12)

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.