Giter Club home page Giter Club logo

bgganalytics's Introduction

bggAnalytics

R package for simple downloading and organisation of board game data using BoardGameGeek's XML API2. Users of R programming language should have no problems extracting their BGG games collection data, or in fact, the information about any games from BGG. This allows for automatisation of the collection exporting task, which has to be done manually on the BGG website.

Installation

The package will be uploaded to CRAN in the future. In the meanwhile, it can be installed using the devtools package.

library(devtools)
install_github("JakubBujnowicz/bggAnalytics")

How To Use?

The package uses R6 classes and data.table package as a backbone for data. Hence usage is heavily leaning on reference, which is quite uncommon for R programming language.

Easiest way to start is to create a bggCollection object for a certain user. For showcase purposes, I'm using my BGG account called Beo_.

library(bggAnalytics)
my_collection <- bggCollection$new(username = "Beo_")
my_collection

Another step would be to fetch some data - everything (from the set of currently supported variables) can be fetched using fetch method.

my_collection$fetch()
# Or
my_collection$fetch(c("name", "yearpublished"))

Method called extend can be used in the same manner to extend object's data slot by given variables.

my_collection$data
# Currently only objectid
my_collection$extend(c("name", "yearpublished"))
my_collection$data

Note that this extension is done by reference, hence no assignment is necessary.

One doesn't have to rely on a given user's collection to download game's data. You can find a game ID by looking at it's BGG hyperlink, e.g. https://boardgamegeek.com/boardgame/167791/terraforming-mars is a link for Terraforming Mars, hence 167791 is it's ID.

games <- bggGames$new(ids = 167791)
games$extend()
games$data

Naturally, multiple IDs may be supplied to bggGames object. One can always extract IDs from a collection by my_collection$ids.

bgganalytics's People

Contributors

jakubbujnowicz avatar

Watchers

 avatar  avatar  avatar  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.