Basic overview of the rmongodb package for R

I have been playing around with MongoDB quite a bit over the last few months.  Because I am much better at coding in R, I decided to write up my notes on how to use the rmongodb package.

This is not a comprehensive tutorial by any stretch, but I wanted to share my notes as I walked through the various tasks that I would need for my projects.

The tutorial and R Markdown file are located here:

If I missed anything, please let me know.  The package has it’s quirks, but just like R, once you work through the functions, it’s pretty powerful.

NOTE:  The tutorial is embedded below.  It doesn’t render that well, so I would recommend hopping over to the gist at the link above.


  4 comments for “Basic overview of the rmongodb package for R

  1. Gláucio
    December 2, 2013 at 11:56 am


    I was researching information about extract NHL Stats in python and I finally found your blog. It’ll be my primary knowledge resource! Congratulations for your dedication and good will to share your thoughts.

    For now, I’d like to plot a graph showing player points per game. To me, personally, the plain stats table doesn’t tell me too much, just numbers… cause it dont tell us who’s actually HOT (even in the bottom) and who’s COLD (even in the top).

    With that said, I would like to know where can I found a “live” NHL DB, so won’t need to do a complex craw to extract points per game by date. I also have another ideas, and a good db would help me a lot.

    Did you mount your own DB or did you craw all the time?

    PS: Maybe I use my raspberry pi to build my own DB, daily.


  2. Wells
    December 2, 2013 at 7:06 pm

    Have you found mongoDB to provide any more value than a RDBMS for your needs? I really like the restrictive aspects of an RDBMS when it comes to data that will be used for analytical purposes.

    • btibert3
      December 12, 2013 at 12:54 pm

      Just saw this. I like Mongo because I can just store the raw JSON as a document during the crawl. From there, I just have to grab the JSON and parse as needed (e.g. into MySQL) or R.

  3. Evandro
    December 3, 2013 at 9:03 am

    Great ! I’ll read with attention later, but your tutorial looks very usefull. Thank you again. :)

Leave a Reply

Your email address will not be published. Required fields are marked *