loon tutorialSince loon is an open ended exploratory data visualization tool, hands on experience with its direct manipulation interface is essential to gain an appreciation of its features.
To get the most out of the tutorial, then, bring a laptop having the most recent versions of R and RStudio installed.
Install:
R from CRAN at https://cran.r-project.org (loon requires at least R 3.4), andRStudio from rstudio.com at https://www.rstudio.com/products/rstudio/download/loon is an R package available directly from CRAN via install.packages("loon"). This is what you need for this tutorial. We recommend that you install the CRAN version of loon.
There is also the “development” version available from github. We do not recommend using this version for the tutorial. However, if you are interested in seeing what we are working on (which may not yet be working, so be warned), you can install the current development version of loon from github as:
devtools::install_github("rwoldford/loon", subdir = "R")
(Assuming you already have devtools installed.)
The following packages are used in loon’s examples and demos as well as in the tutorial. Note that these packages are not needed to install loon, they are just nice to have to run all the examples and demos. You can skip this step and check if your loon installation was successful.
Not all packages are easy to install, so we consider them in three groups.
First, these packages from CRAN should install without any issues:
install.packages(c("maps", "sp", "rworldmap", "RColorBrewer", "scales", "RnavGraphImageData",
"gridExtra", "dimRed", "vegan", "MASS", "zenplots", "ElemStatLearn"))
Similarly, these packages from Bioconductor should also install without any issues
source("https://bioconductor.org/biocLite.R")
biocLite(c("graph", "RDRToolbox", "Rgraphviz"), suppressUpdates = TRUE, suppressAutoUpdate = TRUE)
A few packages from CRAN that will be used in the tutorial may have dependencies that might need special care. These include
PairViz should be easily installed from CRAN using install.packages("PairViz") but because it makes use of the graph from Bioconductor, this will need to be installed first.
scagnostics package (install.packages("scagnostics")) will be used later in the tutorial when dealing with many variates (high-dimensional data) and it requires rJava to be installed which in turn requires java to be installed on your machine and properly linked in R. This is only for one part of the tutorial as an example; it is not necessary to use loon.
rgl (install.packages("rgl")) is not required by loon but might be used to demonstrate how loon can be used to drive other graphics systems
dplyr (install.packages("dplyr")) and magrittr (install.packages("magrittr")) will both be used in the tutorial, though the order of their installation will affect some masking (which does not matter for our purposes, but may for yours in the future)
In R enter
library(loon)
p <- with(iris, l_plot(x = Sepal.Length, y = Sepal.Width, color = Species))
If this creates a scatterplot and an inspector window, then loon was correctly installed.
l_help()In addition to the help pages in R, the function l_help() will pop up a website which can be explored in more detail. This will lead to the site http://waddella.github.io/loon/.
In particular, you could follow the steps in the Install section there (watch that you will be instructed to install from waddella/loon rather than rwoldford/loon; the latter is recommended for this tutorial) to find the above and other recommendations.
More importantly, the Learn with R will guide you in using loon
The direct manipulation interface of loon assumes a two-button mouse with a scroll-wheel. Before the tutorial, make sure that you set up your laptop’s mouse or trackpad so that you have a primary and secondary mouse click and scrolling enabled (as in a document).
The following packages are under development and might be of some interest
loon.ggplot a package which transforms ggplot2 plots into interactive loon plots
devtools::install_github("rwoldford/loon.ggplot")loon.micromaps a package which creates interactive micromaps and conditonal choropleth maps (ccmapa) as loonplots
devtools::install_github("rwoldford/loon.micromaps")Please revisit this site on the day before the tutorial in case there are updates to this information. Such updates may need to be made to your machine to ensure a successful tutorial session.
Good luck and have fun!