Introduction of R package moonBook2(5)

Keon-Woong Moon

2016-07-04

Package installation

Package moonBook is avaiable on CRAN and github. Package moonBook2 is available only on github. Please install moonBook2 package using the following R code.

install.packages("devtools")
devtools::install_github("cardiomoon/moonBook")
devtools::install_github("cardiomoon/moonBook2")

Because functions in “moonBook2” make interactive plots using package “ggiraph”, I strongly recommend you to install the latest version of the package “ggiraph” from github using following R command.

devtools::install_github("davidgohel/ggiraph")

In this vignette, I will show you how to use these functions. 1. ggPair() make an interactive scatterplot with line graph with wide form data.frame 2. ggPairLong() make an interactive scatterplot with line graph with long form data.frame 3. ggScatter() make an interactive scatterplot with linear regression

ggPair()

Basically, ggPair() function draws scatterplot with lineplot. It can be used to visualize paired test or repeated measures ANOVA.

require(ggplot2)
require(ggiraph)
require(moonBook2)

ggPair(iris,interactive=TRUE)

You can zoom-in and zoom-out the plots with your mouse wheel. You can flip the the x-axis and y-aix by setting the parameter horizontal TRUE.

ggPair(iris,horizontal=TRUE,interactive=TRUE)