library(GGally)
RdDB <- tools::Rd_db("GGally")

f <- tempfile()
for(Rd in RdDB) {
  tools::Rd2ex(Rd, f)
  code <- paste(readLines(f), collapse = "\n")
  cat(code)
  print(eval(parse(text = code)))
}
## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: addAndOverwriteAes
## ### Title: Add new aes
## ### Aliases: addAndOverwriteAes
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(diamonds, package="ggplot2")
##  diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],1000),]
##  ggpairs(diamonds.samp, columns = 5:7,
##   upper = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "clarity")),
##   lower = list(continuous = "cor", aes_string = ggplot2::aes_string(color = "cut")),
##   color = "color",
##   title = "Diamonds Sample")

## ### Name: getPlot
## ### Title: getPlot
## ### Aliases: getPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  plotMatrix2 <- ggpairs(tips[,3:2], upper = list(combo = "denstrip"))
##  getPlot(plotMatrix2, 1, 2)

## ### Name: getPlot
## ### Title: getPlot
## ### Aliases: getPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  plotMatrix2 <- ggpairs(tips[,3:2], upper = list(combo = "denstrip"))
##  getPlot(plotMatrix2, 1, 2)

## ### Name: getPlot
## ### Title: getPlot
## ### Aliases: getPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  plotMatrix2 <- ggpairs(tips[,3:2], upper = list(combo = "denstrip"))
##  getPlot(plotMatrix2, 1, 2)

## ### Name: +.gg
## ### Title: Modify a ggpairs object by adding an ggplot2 object to all plots
## ### Aliases: +.gg
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
## pm <- ggpairs(tips[,2:3])
## ## change to black and white theme
## pm + ggplot2::theme_bw()
## ## change to linedraw theme
## # pm + ggplot2::theme_linedraw()
## ## change to custom theme
## # pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue"))

## ### Name: ggally_barDiag
## ### Title: Plots the Bar Plots by Using Diagonal
## ### Aliases: ggally_barDiag
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(movies, package = "ggplot2")
## ggally_barDiag(movies, mapping = ggplot2::aes(x = mpaa))
## # ggally_barDiag(movies, mapping = ggplot2::aes_string(x = "mpaa"))
## # ggally_barDiag(movies, mapping = ggplot2::aes_string(x ="rating", binwidth = ".1"))

## ### Name: ggally_barDiag
## ### Title: Plots the Bar Plots by Using Diagonal
## ### Aliases: ggally_barDiag
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(movies, package = "ggplot2")
## ggally_barDiag(movies, mapping = ggplot2::aes(x = mpaa))
## # ggally_barDiag(movies, mapping = ggplot2::aes_string(x = "mpaa"))
## # ggally_barDiag(movies, mapping = ggplot2::aes_string(x ="rating", binwidth = ".1"))

## ### Name: ggally_box
## ### Title: Plots the Box Plot
## ### Aliases: ggally_box
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_box(tips, mapping = ggplot2::aes(x = total_bill, y = sex))
##  ggally_box(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))
##  ggally_box(
##    tips,
##    mapping        = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex"),
##    outlier.colour = "red",
##    outlier.shape  = 13,
##    outlier.size   = 8
##  )

## ### Name: ggally_cor
## ### Title: Correlation from the Scatter Plot
## ### Aliases: ggally_cor
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
##  ggally_cor(
##    tips,
##    mapping = ggplot2::aes_string(x = "total_bill", y = "tip", size = 15, colour = "red")
##  )
##  ggally_cor(
##    tips,
##    mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"),
##    size = 5
##  )

## ### Name: ggally_density
## ### Title: Plots the Scatter Density Plot
## ### Aliases: ggally_density
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip))
##  ggally_density(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
##  ggally_density(
##    tips,
##    mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..")
##  )
##  ggally_density(
##    tips,
##    mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..")
##  ) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1,0.15,0.2))

## ### Name: ggally_densityDiag
## ### Title: Plots the Density Plots by Using Diagonal
## ### Aliases: ggally_densityDiag
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill))
##  #data(movies)
##  #ggally_densityDiag(movies, mapping = ggplot2::aes_string(x="rating"))
##  #ggally_densityDiag(movies, mapping = ggplot2::aes_string(x="rating", color = "mpaa"))

## ### Name: ggally_denstrip
## ### Title: Plots a tile plot with facets
## ### Aliases: ggally_denstrip
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex))
##  ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))
##  ggally_denstrip(
##    tips,
##    mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2")
##  ) + ggplot2::scale_fill_gradient(low = "grey80", high = "black")

## ### Name: ggally_diagAxis
## ### Title: Internal Axis Labeling Plot for ggpairs
## ### Aliases: ggally_diagAxis
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_diagAxis(tips, ggplot2::aes(x=tip))
##  ggally_diagAxis(tips, ggplot2::aes(x=sex))

## ### Name: ggally_dot
## ### Title: Plots the Box Plot with Dot
## ### Aliases: ggally_dot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_dot(tips, mapping = ggplot2::aes(x = total_bill, y = sex))
##  ggally_dot(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))
##  ggally_dot(
##    tips,
##    mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex")
##  )
##  ggally_dot(
##    tips,
##    mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex", shape = "sex")
##  ) + ggplot2::scale_shape(solid=FALSE)

## ### Name: ggally_dotAndBox
## ### Title: Plots either Box Plot or Dot Plots
## ### Aliases: ggally_dotAndBox
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_dotAndBox(
##    tips,
##    mapping = ggplot2::aes(x = total_bill, y = sex, color = sex),
##    boxPlot = TRUE
##  )
##  ggally_dotAndBox(tips, mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), boxPlot=FALSE)

## ### Name: ggally_facetbar
## ### Title: Plots the Bar Plots Faceted by Conditional Variable
## ### Aliases: ggally_facetbar
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_facetbar(tips, ggplot2::aes(x = sex, y = smoker, fill = time))
##  ggally_facetbar(tips, ggplot2::aes(x = smoker, y = sex, fill = time))

## ### Name: ggally_facetdensity
## ### Title: Plots the density plots by faceting
## ### Aliases: ggally_facetdensity
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex))
##  ggally_facetdensity(
##    tips,
##    mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex")
##  )

## ### Name: ggally_facetdensitystrip
## ### Title: Plots a density plot with facets or a tile plot with facets
## ### Aliases: ggally_facetdensitystrip
## ### Keywords: hplot
## 
## ### ** Examples
## 
## example(ggally_facetdensity)
## example(ggally_denstrip)
## 
## 
## 
## gglly_> data(tips, package = "reshape")
## 
## gglly_>  ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex))

## 
## gglly_>  ggally_facetdensity(
## gglly_+    tips,
## gglly_+    mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex")
## gglly_+  )

## 
## gglly_> data(tips, package = "reshape")
## 
## gglly_>  ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex))

## 
## gglly_>  ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))

## 
## gglly_>  ggally_denstrip(
## gglly_+    tips,
## gglly_+    mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2")
## gglly_+  ) + ggplot2::scale_fill_gradient(low = "grey80", high = "black")

## $value

## 
## $visible
## [1] TRUE
## 
## ### Name: ggally_facethist
## ### Title: Plots the Histograms by Faceting
## ### Aliases: ggally_facethist
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_facethist(tips, mapping = ggplot2::aes(x = tip, y = sex))
##  ggally_facethist(tips, mapping = ggplot2::aes_string(x = "tip", y = "sex"), binwidth = 0.1)
## Warning in loop_apply(n, do.ply): position_stack requires constant width:
## output may be incorrect
## Warning in loop_apply(n, do.ply): position_stack requires constant width:
## output may be incorrect

## ### Name: ggally_points
## ### Title: Plots the Scatter Plot
## ### Aliases: ggally_points
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(mtcars)
## ggally_points(mtcars, mapping = ggplot2::aes(x = disp, y = hp))
## ggally_points(mtcars, mapping = ggplot2::aes_string(x = "disp", y = "hp"))
## ggally_points(
##   mtcars,
##   mapping = ggplot2::aes_string(
##     x     = "disp",
##     y     = "hp",
##     color = "as.factor(cyl)",
##     size  = "gear"
##   )
## )

## ### Name: ggally_ratio
## ### Title: Plots a mosaic plots
## ### Aliases: ggally_ratio
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(movies, package = "ggplot2")
## ggally_ratio(movies[,c("mpaa","Action")])
## ggally_ratio(movies[,c("mpaa","Action")]) + ggplot2::coord_equal()
## nummpaa <- length(levels(movies[,"mpaa"]))
## numAction <- length(levels(as.factor(movies[,"Action"])))
## ggally_ratio(
##   movies[,c("Action","mpaa")]
## ) + ggplot2::theme(
##   aspect.ratio = nummpaa / numAction
## )

## ### Name: ggally_smooth
## ### Title: Plots the Scatter Plot with Smoothing
## ### Aliases: ggally_smooth
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  ggally_smooth(tips, mapping = ggplot2::aes(x = total_bill, y = tip))
##  ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
##  ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"))

## ### Name: ggally_text
## ### Title: GGplot Text
## ### Aliases: ggally_text
## ### Keywords: hplot
## 
## ### ** Examples
## 
## ggally_text("Example 1")
## ggally_text("Example\nTwo", mapping = ggplot2::aes_string(size = 15, color = "red"))

## ### Name: ggcorr
## ### Title: ggcorr - Plot a correlation matrix with ggplot2
## ### Aliases: ggcorr
## 
## ### ** Examples
## 
## # Basketball statistics provided by Nathan Yau at Flowing Data.
## nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv")
## # Default output.
## ggcorr(nba[, -1])
## # Labelled output, with coefficient transparency.
## ggcorr(nba[, -1],
##        label = TRUE,
##        label_alpha = TRUE,
##        name = "") +
##   ggplot2::theme(legend.position = "bottom")
## # Custom options.
## ggcorr(
##   nba[, -1],
##   geom = "circle",
##   max_size = 6,
##   size = 3,
##   hjust = 0.75,
##   angle = -45,
##   palette = "PuOr" # colorblind safe, photocopy-able
## ) + ggplot2::labs(title = "Points Per Game")
## Warning in loop_apply(n, do.ply): Removed 210 rows containing missing
## values (geom_point).

## ### Name: ggfluctuation2
## ### Title: Fluctuation plot
## ### Aliases: ggfluctuation2
## ### Keywords: hplot
## 
## ### ** Examples
## 
## data(movies, package = "ggplot2")
## ggfluctuation2(table(movies$Action, movies$Comedy))
## ggfluctuation2(table(movies$Action, movies$mpaa))
## ggfluctuation2(table(movies[,c("Action", "mpaa")]))
## ggfluctuation2(table(warpbreaks$breaks, warpbreaks$tension))
## ### Name: ggnet
## ### Title: ggnet - Plot a network with ggplot2
## ### Aliases: ggnet
## 
## ### ** Examples
## 
## if(require(network)){
## # make toy random network
## x                  <- 10
## ndyads             <- x * (x - 1)
## density            <- x / ndyads
## nw.mat             <- matrix(0, nrow = x, ncol = x)
## dimnames(nw.mat)   <- list(1:x, 1:x)
## nw.mat[row(nw.mat) != col(nw.mat)] <- runif(ndyads) < density
## nw.mat
## rnd <- network::network(nw.mat)
## rnd
## 
## # random network
## pRnd <- ggnet(rnd, label.nodes = TRUE, alpha = 1, color = "white", segment.color = "grey10")
## # pRnd
## 
## # random groups
## category = LETTERS[rbinom(x, 4, .5)]
## ggnet(rnd, label.nodes = TRUE, color = "white", segment.color = "grey10", node.group = category)
## 
## # city and service firms data from the UCIrvine Network Data Repository
## data(cityServiceFirms, package = "GGally")
## 
## # plot cities, firms and law firms
## type = cityServiceFirms %v% "type"
## type = ifelse(grepl("City|Law", type), gsub("I+", "", type), "Firm")
## pRnd <- ggnet(cityServiceFirms, mode = "kamadakawai", alpha = .2, node.group = type,
##       label.nodes = c("Paris", "Beijing", "Chicago"), color = "darkred")
## # pRnd
## }
## Loading required package: network
## Warning in library(package, lib.loc = lib.loc, character.only = TRUE,
## logical.return = TRUE, : there is no package called 'network'

## NULL
## ### Name: ggpairs
## ### Title: ggpairs - A GGplot2 Matrix
## ### Aliases: ggpairs
## ### Keywords: hplot
## 
## ### ** Examples
## 
## # plotting is reduced to the first couple of examples.
## # Feel free to print the ggpair objects created in the examples
## 
## data(tips, package = "reshape")
## pm <- ggpairs(tips[,1:3])
## # pm
## pm <- ggpairs(tips, 1:3, columnLabels = c("Total Bill", "Tip", "Sex"))
## # pm
## pm <- ggpairs(tips, upper = "blank")
## # pm
## 
## 
## # Custom Example
## pm <- ggpairs(
##   tips[,c(1,3,4,2)],
##   upper = list(continuous = "density", combo = "box"),
##   lower = list(continuous = "points", combo = "dot")
## )
## # pm
## 
## # Use sample of the diamonds data
## data(diamonds, package="ggplot2")
## diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],200),]
## 
## # Custom Example
## pm <- ggpairs(
##  diamonds.samp[,1:5],
##  upper = list(continuous = "density", combo = "box"),
##  lower = list(continuous = "points", combo = "dot"),
##  color = "cut",
##  alpha = 0.4,
##  title = "Diamonds"
## )
## # pm
## 
## # Will plot four "Incorrect Plots"
## bad_plots <- ggpairs(
##   tips[,1:3],
##   upper = list(continuous = "wrongType1", combo = "wrongType2"),
##   lower = list(continuous = "IDK1", combo = "IDK2", discrete = "mosaic"),
## )
## # bad_plots
## 
## # Only Variable Labels on the diagonal (no axis labels)
## pm <- ggpairs(tips[,1:3], axisLabels="internal")
## # pm
## # Only Variable Labels on the outside (no axis labels)
## pm <- ggpairs(tips[,1:3], axisLabels="none")
## # pm
## 
## # Custom Examples
## custom_car <- ggpairs(mtcars[,c("mpg","wt","cyl")], upper = "blank", title = "Custom Example")
## # ggplot example taken from example(geom_text)
##   plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars)))
##   plot <- plot +
##     ggplot2::geom_text(ggplot2::aes(colour=factor(cyl)), size = 3) +
##     ggplot2::scale_colour_discrete(l=40)
## custom_car <- putPlot(custom_car, plot, 1, 2)
## personal_plot <- ggally_text(
##   "ggpairs allows you\nto put in your\nown plot.\nLike that one.\n <---"
## )
## custom_car <- putPlot(custom_car, personal_plot, 1, 3)
## # custom_car

## ### Name: ggparcoord
## ### Title: ggparcoord - A ggplot2 Parallel Coordinate Plot
## ### Aliases: ggparcoord
## 
## ### ** Examples
## 
## # use sample of the diamonds data for illustrative purposes
## data(diamonds, package="ggplot2")
## diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],100),]
## 
## # basic parallel coordinate plot, using default settings
## # ggparcoord(data = diamonds.samp,columns = c(1,5:10))
## 
## # this time, color by diamond cut
## gpd <- ggparcoord(data = diamonds.samp,columns = c(1,5:10),groupColumn = 2)
## # gpd
## 
## # underlay univariate boxplots, add title, use uniminmax scaling
## gpd <- ggparcoord(data = diamonds.samp,columns = c(1,5:10),groupColumn = 2,
##   scale = "uniminmax",boxplot = TRUE,title = "Parallel Coord. Plot of Diamonds Data")
## # gpd
## 
## # utilize ggplot2 aes to switch to thicker lines
## gpd <- ggparcoord(data = diamonds.samp,columns = c(1,5:10),groupColumn = 2,
##   title="Parallel Coord. Plot of Diamonds Data",mapping = ggplot2::aes(size = 1))
## # gpd
## 
## # basic parallel coord plot of the msleep data, using 'random' imputation and
## # coloring by diet (can also use variable names in the columns and groupColumn
## # arguments)
## data(msleep, package="ggplot2")
## gpd <- ggparcoord(data = msleep, columns = 6:11, groupColumn = "vore", missing =
##   "random", scale = "uniminmax")
## # gpd
## 
## # center each variable by its median, using the default missing value handler,
## # 'exclude'
## gpd <- ggparcoord(data = msleep, columns = 6:11, groupColumn = "vore", scale =
##   "center", scaleSummary = "median")
## # gpd
## 
## # with the iris data, order the axes by overall class (Species) separation using
## # the anyClass option
## gpd <- ggparcoord(data = iris, columns = 1:4, groupColumn = 5, order = "anyClass")
## # gpd
## 
## # add points to the plot, add a title, and use an alpha scalar to make the lines
## # transparent
## gpd <- ggparcoord(data = iris, columns = 1:4, groupColumn = 5, order = "anyClass",
##   showPoints = TRUE, title = "Parallel Coordinate Plot for the Iris Data",
##   alphaLines = 0.3)
## # gpd
## 
## # color according to a column
## iris2 <- iris
## iris2$alphaLevel <- c("setosa" = 0.2, "versicolor" = 0.3, "virginica" = 0)[iris2$Species]
## gpd <- ggparcoord(data = iris2, columns = 1:4, groupColumn = 5, order = "anyClass",
##   showPoints = TRUE, title = "Parallel Coordinate Plot for the Iris Data",
##   alphaLines = "alphaLevel")
## # gpd
## 
## ## Use splines on values, rather than lines (all produce the same result)
## columns <- c(1, 5:10)
## gpd <- ggparcoord(diamonds.samp, columns, groupColumn = 2, splineFactor = TRUE)
## # gpd
## gpd <- ggparcoord(diamonds.samp, columns, groupColumn = 2, splineFactor = 3)
## # gpd
## splineFactor <- length(columns) * 3
## gpd <- ggparcoord(diamonds.samp, columns, groupColumn = 2, splineFactor = I(splineFactor))
## # gpd

## ### Name: ggscatmat
## ### Title: ggscatmat - a traditional scatterplot matrix for purely
## ###   quantitative variables
## ### Aliases: ggscatmat
## 
## ### ** Examples
## 
## data(flea)
## ggscatmat(flea, columns = 2:4)
## ggscatmat(flea, columns = 2:4, color="species")
## ### Name: ggsurv
## ### Title: Plot 'survfit' objects using 'ggplot2'
## ### Aliases: ggsurv
## 
## ### ** Examples
## 
## if (require(survival) && require(scales)) {
##   data(lung, package = "survival")
##   sf.lung <- survival::survfit(Surv(time, status) ~ 1, data = lung)
##   ggsurv(sf.lung)
## 
##   # Multiple strata examples
##   sf.sex <- survival::survfit(Surv(time, status) ~ sex, data = lung)
##   pl.sex <- ggsurv(sf.sex)
##   pl.sex
## 
##   # Adjusting the legend of the ggsurv fit
##   pl.sex +
##     ggplot2::guides(linetype = FALSE) +
##     ggplot2::scale_colour_discrete(
##       name   = 'Sex',
##       breaks = c(1,2),
##       labels = c('Male', 'Female')
##     )
## 
##   # We can still adjust the plot after fitting
##   data(kidney, package = "survival")
##   sf.kid <- survival::survfit(Surv(time, status) ~ disease, data = kidney)
##   pl.kid <- ggsurv(sf.kid, plot.cens = FALSE)
##   pl.kid
## 
##   # Zoom in to first 80 days
##   pl.kid <- pl.kid + ggplot2::coord_cartesian(xlim = c(0, 80), ylim = c(0.45, 1))
##   pl.kid
## 
##   # Add the diseases names to the plot and remove legend
##   col <- scales::hue_pal(
##     h         = c(0, 360) + 15,
##     c         = 100,
##     l         = 65,
##     h.start   = 0,
##     direction = 1
##   )(4)
##   pl.kid +
##     ggplot2::annotate(
##       "text",
##       label  = c('AN', 'GN', 'Other', 'PKD'),
##       x      = c(50, 20, 50, 71),
##       y      = c(0.47, 0.55, 0.67, 0.8),
##       size   = 5,
##       colour = col
##     ) +
##     ggplot2::guides(color = FALSE, linetype = FALSE)
## }
## Loading required package: survival
## Loading required package: scales
## Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.

## ### Name: glyphs
## ### Title: Create the data needed to generate a glyph plot.
## ### Aliases: glyphs
## 
## ### ** Examples
## 
## data(nasa)
##  nasaLate <- nasa[nasa$date >= as.POSIXct("1998-01-01"), ]
##  temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5)
##  ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) +
##    add_ref_lines(temp.gly, color = "grey90") +
##    add_ref_boxes(temp.gly, color = "grey90") +
##    ggplot2::geom_path() +
##    ggplot2::theme_bw() +
##    ggplot2::labs(x = "", y = "")
## Using width 2.38

## ### Name: glyphs
## ### Title: Create the data needed to generate a glyph plot.
## ### Aliases: glyphs
## 
## ### ** Examples
## 
## data(nasa)
##  nasaLate <- nasa[nasa$date >= as.POSIXct("1998-01-01"), ]
##  temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5)
##  ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) +
##    add_ref_lines(temp.gly, color = "grey90") +
##    add_ref_boxes(temp.gly, color = "grey90") +
##    ggplot2::geom_path() +
##    ggplot2::theme_bw() +
##    ggplot2::labs(x = "", y = "")
## Using width 2.38

## ### Name: is_blank_plot
## ### Title: Is Blank Plot? Find out if the plot equals a blank plot
## ### Aliases: is_blank_plot
## ### Keywords: internal
## 
## ### ** Examples
## 
## GGally:::is_blank_plot(ggally_blank())
##  GGally:::is_blank_plot(ggally_points(mtcars, ggplot2::aes_string(x = "disp", y = "hp")))
## 
## 
## [1] FALSE
## ### Name: lowertriangle
## ### Title: lowertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: lowertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(lowertriangle(flea, columns= 2:4))
## head(lowertriangle(flea))
## head(lowertriangle(flea, color="species"))
## 
## 
##   xvalue yvalue xslot yslot  xlab  ylab colorcolumn
## 1    191     NA     1     1 tars1 tars1    Concinna
## 2    185     NA     1     1 tars1 tars1    Concinna
## 3    200     NA     1     1 tars1 tars1    Concinna
## 4    173     NA     1     1 tars1 tars1    Concinna
## 5    171     NA     1     1 tars1 tars1    Concinna
## 6    160     NA     1     1 tars1 tars1    Concinna
## ### Name: lowertriangle
## ### Title: lowertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: lowertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(lowertriangle(flea, columns= 2:4))
## head(lowertriangle(flea))
## head(lowertriangle(flea, color="species"))
## 
## 
##   xvalue yvalue xslot yslot  xlab  ylab colorcolumn
## 1    191     NA     1     1 tars1 tars1    Concinna
## 2    185     NA     1     1 tars1 tars1    Concinna
## 3    200     NA     1     1 tars1 tars1    Concinna
## 4    173     NA     1     1 tars1 tars1    Concinna
## 5    171     NA     1     1 tars1 tars1    Concinna
## 6    160     NA     1     1 tars1 tars1    Concinna
## ### Name: lowertriangle
## ### Title: lowertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: lowertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(lowertriangle(flea, columns= 2:4))
## head(lowertriangle(flea))
## head(lowertriangle(flea, color="species"))
## 
## 
##   xvalue yvalue xslot yslot  xlab  ylab colorcolumn
## 1    191     NA     1     1 tars1 tars1    Concinna
## 2    185     NA     1     1 tars1 tars1    Concinna
## 3    200     NA     1     1 tars1 tars1    Concinna
## 4    173     NA     1     1 tars1 tars1    Concinna
## 5    171     NA     1     1 tars1 tars1    Concinna
## 6    160     NA     1     1 tars1 tars1    Concinna
## ### Name: lowertriangle
## ### Title: lowertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: lowertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(lowertriangle(flea, columns= 2:4))
## head(lowertriangle(flea))
## head(lowertriangle(flea, color="species"))
## 
## 
##   xvalue yvalue xslot yslot  xlab  ylab colorcolumn
## 1    191     NA     1     1 tars1 tars1    Concinna
## 2    185     NA     1     1 tars1 tars1    Concinna
## 3    200     NA     1     1 tars1 tars1    Concinna
## 4    173     NA     1     1 tars1 tars1    Concinna
## 5    171     NA     1     1 tars1 tars1    Concinna
## 6    160     NA     1     1 tars1 tars1    Concinna
## ### Name: lowertriangle
## ### Title: lowertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: lowertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(lowertriangle(flea, columns= 2:4))
## head(lowertriangle(flea))
## head(lowertriangle(flea, color="species"))
## 
## 
##   xvalue yvalue xslot yslot  xlab  ylab colorcolumn
## 1    191     NA     1     1 tars1 tars1    Concinna
## 2    185     NA     1     1 tars1 tars1    Concinna
## 3    200     NA     1     1 tars1 tars1    Concinna
## 4    173     NA     1     1 tars1 tars1    Concinna
## 5    171     NA     1     1 tars1 tars1    Concinna
## 6    160     NA     1     1 tars1 tars1    Concinna
## ### Name: print.ggpairs
## ### Title: Print ggpair object
## ### Aliases: print.ggpairs
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  pMat <- ggpairs(tips, c(1,3,2), color = "sex")
##  pMat # calls print(pMat), which calls print.ggpairs(pMat)
## 
##  ## defaults; (prints strips on top and right edges of matrix)
##  # print(pMat, left = 0.2, spacing = 0.03, bottom = 0.1, showStrips = NULL)
## 
##  ## show none of the strips
##  # print(pMat, showStrips = FALSE)
## 
##  ## show all of the strips
##  # print(pMat, showStrips = TRUE)
## 
##  ## give the left axis labels area a proportion of 3 plot size
##  # print(pMat, leftWidthProportion = 3)
## 
##  ## give the bottom axis labels area a proportion of 1 plot size
##  # print(pMat, bottomHeightProportion = 1)
## 
##  ## give the spacing between plots a proportion of 1 plot size
##  # print(pMat, spacing = 1)

## ### Name: print.ggpairs
## ### Title: Print ggpair object
## ### Aliases: print.ggpairs
## ### Keywords: internal
## 
## ### ** Examples
## 
## data(tips, package = "reshape")
##  pMat <- ggpairs(tips, c(1,3,2), color = "sex")
##  pMat # calls print(pMat), which calls print.ggpairs(pMat)
## 
##  ## defaults; (prints strips on top and right edges of matrix)
##  # print(pMat, left = 0.2, spacing = 0.03, bottom = 0.1, showStrips = NULL)
## 
##  ## show none of the strips
##  # print(pMat, showStrips = FALSE)
## 
##  ## show all of the strips
##  # print(pMat, showStrips = TRUE)
## 
##  ## give the left axis labels area a proportion of 3 plot size
##  # print(pMat, leftWidthProportion = 3)
## 
##  ## give the bottom axis labels area a proportion of 1 plot size
##  # print(pMat, bottomHeightProportion = 1)
## 
##  ## give the spacing between plots a proportion of 1 plot size
##  # print(pMat, spacing = 1)

## ### Name: putPlot
## ### Title: Put Plot
## ### Aliases: putPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## custom_car <- ggpairs(mtcars[,c("mpg","wt","cyl")], upper = "blank", title = "Custom Example")
## # ggplot example taken from example(geom_text)
##   plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars)))
##   plot <- plot +
##     ggplot2::geom_text(ggplot2::aes(colour=factor(cyl)), size = 3) +
##     ggplot2::scale_colour_discrete(l=40)
## custom_car <- putPlot(custom_car, plot, 1, 2)
## personal_plot <- ggally_text(
##   "ggpairs allows you\nto put in your\nown plot.\nLike that one.\n <---"
## )
## custom_car <- putPlot(custom_car, personal_plot, 1, 3)
## # custom_car

## ### Name: putPlot
## ### Title: Put Plot
## ### Aliases: putPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## custom_car <- ggpairs(mtcars[,c("mpg","wt","cyl")], upper = "blank", title = "Custom Example")
## # ggplot example taken from example(geom_text)
##   plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars)))
##   plot <- plot +
##     ggplot2::geom_text(ggplot2::aes(colour=factor(cyl)), size = 3) +
##     ggplot2::scale_colour_discrete(l=40)
## custom_car <- putPlot(custom_car, plot, 1, 2)
## personal_plot <- ggally_text(
##   "ggpairs allows you\nto put in your\nown plot.\nLike that one.\n <---"
## )
## custom_car <- putPlot(custom_car, personal_plot, 1, 3)
## # custom_car

## ### Name: putPlot
## ### Title: Put Plot
## ### Aliases: putPlot
## ### Keywords: hplot
## 
## ### ** Examples
## 
## custom_car <- ggpairs(mtcars[,c("mpg","wt","cyl")], upper = "blank", title = "Custom Example")
## # ggplot example taken from example(geom_text)
##   plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars)))
##   plot <- plot +
##     ggplot2::geom_text(ggplot2::aes(colour=factor(cyl)), size = 3) +
##     ggplot2::scale_colour_discrete(l=40)
## custom_car <- putPlot(custom_car, plot, 1, 2)
## personal_plot <- ggally_text(
##   "ggpairs allows you\nto put in your\nown plot.\nLike that one.\n <---"
## )
## custom_car <- putPlot(custom_car, personal_plot, 1, 3)
## # custom_car

## ### Name: scatmat
## ### Title: scatmat - plot the lowertriangle plots and density plots of the
## ###   scatter plot matrix.
## ### Aliases: scatmat
## 
## ### ** Examples
## 
## data(flea)
## scatmat(flea, columns=2:4)
## scatmat(flea, columns= 2:4, color="species")

## ### Name: scatmat
## ### Title: scatmat - plot the lowertriangle plots and density plots of the
## ###   scatter plot matrix.
## ### Aliases: scatmat
## 
## ### ** Examples
## 
## data(flea)
## scatmat(flea, columns=2:4)
## scatmat(flea, columns= 2:4, color="species")

## ### Name: scatmat
## ### Title: scatmat - plot the lowertriangle plots and density plots of the
## ###   scatter plot matrix.
## ### Aliases: scatmat
## 
## ### ** Examples
## 
## data(flea)
## scatmat(flea, columns=2:4)
## scatmat(flea, columns= 2:4, color="species")

## ### Name: uppertriangle
## ### Title: uppertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: uppertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(uppertriangle(flea, columns=2:4))
## head(uppertriangle(flea))
## head(uppertriangle(flea, color="species"))
## 
## 
##    ylab  xlab colorcolumn    r xvalue yvalue
## 1 tars1 tars2    Concinna 0.77  126.5    152
## 2 tars1 tars2    Heikert. 0.64  126.5    182
## 3 tars1 tars2   Heptapot. 0.56  126.5    212
## 4 tars1  head    Concinna 0.68   50.5    152
## 5 tars1  head    Heikert. 0.65   50.5    182
## 6 tars1  head   Heptapot. 0.77   50.5    212
## ### Name: uppertriangle
## ### Title: uppertriangle - rearrange dataset as the preparation of
## ###   ggscatmat function
## ### Aliases: uppertriangle
## 
## ### ** Examples
## 
## data(flea)
## head(uppertriangle(flea, columns=2:4))
## head(uppertriangle(flea))
## head(uppertriangle(flea, color="species"))
## 
## 
##    ylab  xlab colorcolumn    r xvalue yvalue
## 1 tars1 tars2    Concinna 0.77  126.5    152
## 2 tars1 tars2    Heikert. 0.64  126.5    182
## 3 tars1 tars2   Heptapot. 0.56  126.5    212
## 4 tars1  head    Concinna 0.68   50.5    152
## 5 tars1  head    Heikert. 0.65   50.5    182
## 6 tars1  head   Heptapot. 0.77   50.5    212