Giter Site home page Giter Site logo

dryscrape's Introduction

DryScrape

  • FRANCAIS A SUIVRE

Required packages: rvest, dplyr, RCurl

scrape.RData contains two functions.

The first, todays.games(), returns a vector of nhl game IDs for a given season and date.

The second, scrape(), returns two data frames (one play-by-play, one roster) for a given range of IDs, season and according to the specification provided by the names boolean.

The season argument must be a string in the "yyyyyyyy" format, the date argument a string in the "m/d/yyyy" format, the IDs numeric, and names one of TRUE or FALSE.

names = TRUE will provoke all player values to take the form "FIRSTNAME.LASTNAME", names = FALSE will cause player values to exist as a "TEAM##" code.

DryScrape.R contains the complete code for both functions, as well as an example of scrape() usage.

scrape() example

scrape(season = "20152016", start = 20001, end = 20012, names = TRUE) # scrape games 20001-20012 from the 20152016 season, with names

todays.games() example

todays.games("20152016", "1/16/2016") # Provide IDs for games played on 1/16/2016 of the 20152016 season

Paquets requis: rvest, dplyr, RCurl

scrape.RData contient deux fonctions.

Le premier, scrape(), produit deux tables (un résumé de match, une formation) pour une gamme de codes de match et une saison donnée, ainsi qu'une spécification fourni par l'argument "names".

L'argument "season" doit être un élement caractère du format "yyyyyyyy", l'argument date, un élement caractère du format "m/d/yyyy", les codes de match en numérique, et l'argument "names" un parmi TRUE ou FALSE.

names = TRUE causera toutes les valeurs de joueurs a prendre la forme "PRENOM.NOM", names = FALSE causera toutes les valeurs de joueurs a éxister come codes "EQUIP##".

DryScrape.R contient le code complet pour les deux fonctions, ainsi qu'un example pour la fonction scrape().

Example pour scrape()

scrape(season = "20152016", start = 20001, end = 20012, names = TRUE) # Acquérir les matchs 20001-20012 de la saison 20152016, avec noms

Example pour todays.games()

todays.games("20152016", "1/16/2016") # Procurer les codes de matchs joués sur la date 1/16/2016 de la saison 20152016

dryscrape's People

Contributors

mannyelk avatar

Watchers

Alex Gable avatar

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.