Type: Package
Version: 0.2.7
Title: A Graphical EDA Tool
Description: An automated graphical exploratory data analysis (EDA) tool that introduces: a.) wideplot graphics for exploring the structure of a dataset through a grid of variables and graphic types. b.) longplot graphics, which present the entire catalog of available graphics for representing a particular variable using a grid of graphic types and variations on these types. c.) plotup function, which presents a particular graphic for a specific variable of a dataset. The plotup() function also makes it possible to obtain the code used to generate the graphic, meaning that the user can adjust its properties as needed. d.) matrixplot graphics that is a grid of a particular graphic showing bivariate relationships between all pairs of variables of a certain(s) type(s) in a multivariate data set.
License: GPL-3
Encoding: UTF-8
LazyData: false
Imports: ggplot2, gridExtra, rmarkdown, glue, pander, lubridate, tibble, sm, RColorBrewer, forcats, GGally, patchwork, scales
Suggests: knitr, MASS, hexbin, testthat (≥ 2.1.0)
VignetteBuilder: knitr
RoxygenNote: 7.1.1
SystemRequirements: Pandoc (>= 1.12.3), web browser
URL: https://sciencegraph.github.io/brinton/, https://github.com/sciencegraph/brinton
BugReports: https://github.com/sciencegraph/brinton/issues
NeedsCompilation: no
Packaged: 2022-12-29 21:44:48 UTC; pmillan
Author: Pere Millán-Martínez [aut, cre], Ramon Oller Piqué [ctb]
Maintainer: Pere Millán-Martínez <info@sciencegraph.org>
Repository: CRAN
Date/Publication: 2023-01-07 14:00:10 UTC

Displays a longplot in a html file.

Description

A longplot is a range of suitable graphics that represent the relationship within the values of one, or a limited number, of variables in a dataset. Each graphic relates the values of all the selected variables and eventually the row number in which they appear.

Usage

longplot(data, vars, label = TRUE, dir = tempdir())

Arguments

data

Data.frame. Default dataset to use for plot. If not already a data.frame, it should be first coerced to by [as.data.frame()].

vars

Character. A specific variable within the dataset.

label

Logical. If 'TRUE' the output includes labels that show the names of the graphics that are being displayed.

dir

Directory in which the files are stored.

Details

In order to present the range of graphics, the user must define a dataset and select at least one variable whitin it. Future work will include graphics that can combine up to three variables.

Value

Cause the side-effect of creating and displaying a temporary html file that includes a range of graphics suitable for this particular combination of variables.

See Also

Specimens of grphics for univariate and bivariate data.

Examples

if (interactive()) {
longplot(esoph, "tobgp")
}

Displays a matrixplot of a particular type of graphic from those included in the specimen for bivariate data in a html file.

Description

A matrixplot is a grid of a particular type of graphic showing bivariate relationships between all pairs of variables of a certain(s) type(s) in a multivariate data set.

Usage

matrixplot(data, dataclass = NULL, diagram = NULL, dir = tempdir())

Arguments

data

Data.frame. Default dataset to use for plot. Unquoted. If not already a data.frame, it should be first coerced to by as.data.frame().

dataclass

Character vector. The types of data to be considered among the following:

  • 'logical'

  • 'ordered'

  • 'factor'

  • 'numeric'

  • 'datetime'

  • 'character'

diagram

Character. A specific graphic to be presented within the ones considered in the 2 input variables specimen available at https://sciencegraph.github.io/brinton/articles/specimen2.html.

dir

Directory in which the files are stored.

Value

Cause the side-effect of creating and displaying a temporary html file that includes a grid of graphics. The variables of a dataset are first grouped by the type of data, then, the variables matching the classes specified in the dataclass parameter, are represented in each row and/or column of the matrix.

See Also

Specimen for bivariate data.

Examples

if (interactive()) {
matrixplot(iris, dataclass = c("numeric","numeric"),
diagram="bw contour plot with data points")
}

Returns a ggplot object of a specific graphic explicitly called by name from the ones included in the specimens

Description

Returns a ggplot object of a specific graphic explicitly called by name from the ones included in the specimens

Usage

plotup(data, vars, diagram, output = "plots pane", dir = tempdir())

Arguments

data

Data.frame. Default dataset to use for plot. If not already a data.frame, it should be first coerced to by [as.data.frame()].

vars

Character. A variable within the dataset.

diagram

Character. A specific graphic to be presented within the ones considered by the 'logical', 'ordered', 'factor', 'character', 'datetime' and 'numeric' arguments of the 'wideplot()' function.

output

Character. Type of output.

  • 'html': Creates and displays a html file with the specific graphic.

  • 'plots pane': Default output, a ggplot2 object in RStudio's plots pane.

  • 'console': Prints the code that produces the specific graphic.

dir

Directory in which the files are stored.

Value

This function returns a c('gg', 'ggplot') object, but if the 'output' argument is set to it 'html' or 'console', the function cause a side-effect: either creating and displaying a temporary html file, or printing the ggplot2 code to the console.

See Also

Specimens of graphics for univariate and bivariate data.

Examples

plotup(iris, "Petal.Width", "color heatmap")
plotup(iris, "Petal.Width", "color heatmap", output = "console")
if (interactive()) {
plotup(iris, "Petal.Width", "color heatmap", output = "html")
}

Displays a wideplot in a html file.

Description

A wideplot is a grid of graphics where the graphics within each row corresponds to graphical representations of each one of the variables considered within a given dataset. The types of variables and the types of graphics are limited to those included in the specimen of graphics that require one input variable.

Usage

wideplot(
  data,
  dataclass = NULL,
  logical = NULL,
  ordered = NULL,
  factor = NULL,
  character = NULL,
  datetime = NULL,
  numeric = NULL,
  group = NULL,
  ncol = 7,
  label = "FALSE",
  dir = tempdir()
)

Arguments

data

Data.frame. Default dataset to use for plot. Unquoted. If not already a data.frame, it should be first coerced to by as.data.frame().

dataclass

Character vector. The types of data to be considered among the following:

  • 'logical'

  • 'ordered'

  • 'factor'

  • 'numeric'

  • 'datetime'

  • 'character'

logical

Character vector. Graphics for logical variables among the following:

  • 'blank'

  • 'line graph'

  • 'tile plot'

  • 'point graph'

  • 'point-to-point graph'

  • 'linerange graph'

  • 'bar graph'

  • 'bw bar graph'

  • 'color bar graph'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

ordered

Character vector. Graphics for ordered factor variables among the following:

  • 'blank'

  • 'line graph'

  • 'tile plot'

  • 'point graph'

  • 'point-to-point graph'

  • 'linerange graph'

  • 'bar graph'

  • 'bw bar graph'

  • 'color bar graph'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

factor

Character vector. Graphics for Character variables among the following:

  • 'blank'

  • 'line graph'

  • 'freq. reordered line graph'

  • 'alphab. reordered line graph'

  • 'tile plot'

  • 'freq. reordered tile plot'

  • 'alphab. reordered tile plot'

  • 'point graph'

  • 'freq. reordered point graph'

  • 'alphab. reordered point graph'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

  • 'freq. reordered binned heatmap'

  • 'bw freq. reordered binned heatmap'

  • 'color freq. reordered binned heatmap'

  • 'alphab. reordered binned heatmap'

  • 'bw alphab. reordered binned heatmap'

  • 'color alphab. reordered binned heatmap'

  • 'point-to-point graph'

  • 'freq. reordered point-to-point graph'

  • 'alphab. reordered point-to-point graph'

  • 'linerange graph'

  • 'freq. reordered linerange graph'

  • 'alphab. reordered linerange graph'

  • 'bar graph'

  • 'bw bar graph'

  • 'color bar graph'

  • 'freq. reordered bar graph'

  • 'bw freq. reordered bar graph'

  • 'color freq. reordered bar graph'

  • 'alphab. reordered bar graph'

  • 'bw alphab. reordered bar graph'

  • 'color alphab. reordered bar graph'

character

Character vector. Graphics for character variables among the following:

  • 'blank'

  • 'line graph'

  • 'freq. reordered line graph'

  • 'alphab. reordered line graph'

  • 'tile plot'

  • 'freq. reordered tile plot'

  • 'alphab. reordered tile plot'

  • 'point graph'

  • 'freq. reordered point graph'

  • 'alphab. reordered point graph'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

  • 'freq. reordered binned heatmap'

  • 'bw freq. reordered binned heatmap'

  • 'color freq. reordered binned heatmap'

  • 'alphab. reordered binned heatmap'

  • 'bw alphab. reordered binned heatmap'

  • 'color alphab. reordered binned heatmap'

  • 'point-to-point graph'

  • 'freq. reordered point-to-point graph'

  • 'alphab. reordered point-to-point graph'

  • 'linerange graph'

  • 'freq. reordered linerange graph'

  • 'alphab. reordered linerange graph'

  • 'bar graph'

  • 'bw bar graph'

  • 'color bar graph'

  • 'freq. reordered bar graph'

  • 'bw freq. reordered bar graph'

  • 'color freq. reordered bar graph'

  • 'alphab. reordered bar graph'

  • 'bw alphab. reordered bar graph'

  • 'color alphab. reordered bar graph'

datetime

Character vector. Graphics for datetime variables among the following:

  • 'blank'

  • 'line graph'

  • 'stepped line graph'

  • 'point graph'

  • 'point-to-point graph'

  • 'stepped point-to-point graph'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

  • 'bw heatmap'

  • 'color heatmap'

numeric

Character vector. Graphics for numeric variables among the following:

  • 'blank'

  • 'area graph'

  • 'stepped area graph'

  • 'bw stepped area graph'

  • 'color stepped area graph'

  • 'seq. stripe graph'

  • 'bw seq. stripe graph'

  • 'color seq. stripe graph'

  • 'line graph'

  • 'stepped line graph'

  • 'stripe graph'

  • 'bw stripe graph'

  • 'color stripe graph'

  • 'binned stripe graph'

  • 'bw binned stripe graph'

  • 'color binned stripe graph'

  • 'point graph'

  • 'bw point graph'

  • 'color point graph'

  • 'point graph with trend line'

  • 'bw point graph with trend line'

  • 'color point graph with trend line'

  • 'binned heatmap'

  • 'bw binned heatmap'

  • 'color binned heatmap'

  • 'bw heatmap'

  • 'color heatmap'

  • 'binned point graph'

  • 'bw binned point graph'

  • 'color binned point graph'

  • 'point-to-point graph'

  • 'stepped point-to-point graph'

  • 'bar graph'

  • 'bw bar graph'

  • 'color bar graph'

  • 'histogram'

  • 'bw histogram'

  • 'color histogram'

  • 'density plot'

  • 'filled density plot'

  • 'violin plot'

  • 'filled violin plot'

  • 'box plot'

  • '3 uniaxial'

  • 'normal qq plot'

  • 'ecdf plot'

  • 'dotted ecdf plot'

  • 'stepped ecdf plot'

group

Quoted character. Group of prestablished graphics which marks represent:

  • 'sequence': the row number of the observations.

  • 'scatter': graphics which marks represent individual observations.

  • 'bin': observations into a series of intervals.

  • 'model': a model built from the observations.

  • 'symbol': different statistics through symbols.

  • 'GOF': the goodness of fit of a statistical model.

  • 'random': random graphics.

ncol

Numeric. Number of columns. An integer between 3 and 7. The fewer columns displayed, the larger the size of the resulting graphics, a feature that is especially useful if the scale labels dwarf the graphics area.

label

Logical. If 'TRUE' the output includes labels that show the names of the graphics that are being displayed.

dir

Directory in which the files are stored.

Value

Cause the side-effect of creating and displaying a temporary html file that includes a grid of graphics. The variables of a dataset are first grouped by the type of data, then, each variable is graphically represented into a range of different graphics in one row of the matrix.

See Also

Specimen for univariate data.

Examples

if (interactive()) {
wideplot(sleep, dataclass = c("factor"),
factor=c("point graph", "line graph", "tile plot"),
numeric = c("point graph", "line graph", "stepped line graph"))
}