<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/teach-kids-about-r-with-minecraft/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/06/teach-kids-about-r-with-minecraft.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>As I <a rel="nofollow" href="http://blog.revolutionanalytics.com/2017/05/runconf17.html" target="_blank">mentioned</a> earlier this week, I was on a team at the ROpenSci Unconference (with <a rel="nofollow" href="https://github.com/geanders" target="_blank">Brooke Anderson</a>, <a rel="nofollow" href="https://github.com/kbroman" target="_blank">Karl Broman</a>, <a rel="nofollow" href="https://github.com/daroczig" target="_blank">Gergely Daróczi</a>, and my Microsoft colleagues <a rel="nofollow" href="https://github.com/inchiosa" target="_blank">Mario Inchiosa</a> and <a rel="nofollow" href="https://github.com/revodavid" target="_blank"></a><a rel="nofollow" href="https://github.com/akzaidi" target="_blank">Ali Zaidi</a>) to work on a project to interface the <a rel="nofollow" href="https://mran.microsoft.com/documents/what-is-r/" target="_blank">R language</a> with <a rel="nofollow" href="https://minecraft.net/en-us/" target="_blank">Minecraft</a>. The resulting R package, <a rel="nofollow" href="https://github.com/ropenscilabs/miner" target="_blank">miner</a>, is now available to install from Github. The goal of the package is to introduce budding programmers to the R language via their interest in Minecraft, and to that end there's also a book (<a rel="nofollow" href="https://ropenscilabs.github.io/miner_book/index.html" target="_blank">R Programming with Minecraft</a>) and associated R package (<a rel="nofollow" href="https://github.com/ROpenSciLabs/craft" target="_blank">craft</a>) under development to provide lots of fun examples of manipulating the Minecraft world with R.</p>
<div><a rel="nofollow" href="https://ropenscilabs.github.io/miner_book/rendering-the-r-logo-in-minecraft.html" target="_blank"><img alt="Rlogo_minecraft" title="Rlogo_minecraft" src="http://a2.typepad.com/6a0105360ba1c6970c01bb09a19c32970d-450wi"></a>
<div>Create objects in Minecraft with R functions</div>
</div>
<p>If you're a parent you're probably already aware of the Minecraft phenomenon, but if not: it's kinda like the Lego of the digital generation. Kids (and kids-and-heart) enter a virtual 3-D world composed of cubes representing ground, water, trees and other materials, and use those cubes to build their own structures, which they can then explore with their friends using their in-game avatars. Inspired by the Python-focused book &quot;<a rel="nofollow" href="https://www.nostarch.com/programwithminecraft" target="_blank">Learn to program with Minecraft</a>&quot;, Karl had the brilliant idea of building a similar interface around R. </p>
<p>The miner package provides just a few simple functions to manipulate the game world: find or move a player's position; add or remove blocks in the world; send a message to all players in the world. The functions are deliberately simple, designed to be used to build more complex tasks. For example, you could write a function to detect when a player is standing in a hole. It uses the <code>getPlayerIds</code> and <code>getPlayerPos</code> functions to find the ID and locations of all players in the world, and the <code>getBlocks</code> function to check if the player is surrounded by blocks that are not code <code>0</code> (air).</p>
<p></p>
<p>The package also provides are also a couple of &quot;listener&quot; functions: you can detect player chat messages, or when players strike a block with their sword. You can then use to write functions to react to player actions. For example, you can write a <a rel="nofollow" href="https://ropenscilabs.github.io/miner_book/number-guess-chat-bot-in-minecraft.html" target="_blank">chat-bot to play a game with the player</a>, create an <a rel="nofollow" href="https://ropenscilabs.github.io/miner_book/random-walks-in-the-minecraft-world.html" target="_blank">AI to solve an in-game maze</a>, or give the player the power's of Elsa from <a rel="nofollow" href="http://www.imdb.com/title/tt2294629/" target="_blank">Frozen</a> to <a rel="nofollow" href="https://github.com/ropenscilabs/craft/blob/master/R/elsafy.R" target="_blank">freeze water by walking on it</a>: </p>
<p><iframe width="450" allowfullscreen="" src="https://www.youtube.com/embed/6gcRyuj0smg?rel=0" height="281"></iframe></p>
<p>To get started with the miner package, you'll need to <a rel="nofollow" href="https://minecraft.net/en-us/store/?ref=m" target="_blank">purchase a copy of Minecraft</a> for Windows, Mac or Linux if you don't have one already. (Note: the Windows 10 version from the Microsoft Store isn't compatible with the miner package.) This is what you'll use to explore the world managed by the Minecraft server, which you'll also need to install along with <a rel="nofollow" href="https://dev.bukkit.org/projects/raspberryjuice" target="_blank">RaspberryJuice</a> plugin. You can find setup details in the <a rel="nofollow" href="https://github.com/ropenscilabs/miner/blob/master/vignettes/miner.Rmd" target="_blank">miner package vignette</a>. We installed the open-source <a rel="nofollow" href="https://www.spigotmc.org/" target="_blank">Spigot</a> server on a Ubuntu VM running in Azure; you might find this <a rel="nofollow" href="https://github.com/ropenscilabs/miner/blob/master/extra_vignettes/Dockerfile" target="_blank">Dockerfile</a> helpful if you're trying something similar.</p>
<p>The miner package and craft package available to install from Github at the link below. The packages are a work-in-progress: comments, suggestions, pull-requests and additional examples for the <a rel="nofollow" href="https://ropenscilabs.github.io/miner_book/index.html" target="_blank">R Programming with Minecraft book</a> are most welcome!</p>
<p>Github (ROpenSci labs): <a rel="nofollow" href="https://github.com/ROpenSciLabs/miner" target="_blank">miner</a> and <a rel="nofollow" href="https://github.com/ropenscilabs/craft" target="_blank">craft</a></p>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/06/teach-kids-about-r-with-minecraft.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...

	<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/zwn8WKWvR2A" height="1"></a></div>