Learn R Programming

inspectdf (version 0.0.2)

show_plot: Visualise summaries and comparisons of one or two dataframes.

Description

Visualise summaries and comparisons of one or two dataframes.

Usage

show_plot(x, text_labels = TRUE, alpha = 0.05, high_cardinality = 0,
  plot_layout = NULL, cols = c("tomato3", "gray65", "darkmagenta"))

Arguments

x

Dataframe resulting from a call to an `inspect_` function.

text_labels

Whether to show text annotation on plots (when show_plot = T).

alpha

Alpha level for performing significance tests. Defaults to 0.05.

high_cardinality

Minimum number of occurrences of category to be shown as a distinct segment in the plot (inspect_cat only). Default is 0. This can help when some columns contain many unique or near-unique levels that take a long time to render.

plot_layout

Vector specifying the number of rows and columns in the plotting grid. For example, 3 rows and 2 columns would be specified as plot_layout = c(3, 2). Default is TRUE.

cols

Vector containing names or integers indicating colours for the plotted bars for levels, missing values and for high cardinality values, respectively.

Examples

Run this code
# NOT RUN {
# Load 'starwars' data
data("starwars", package = "dplyr")

# categorical plot
x <- inspect_cat(starwars) 
show_plot(x)

# correlations in numeric columns
x <- inspect_cor(starwars)
show_plot(x)

# feature imbalance bar plot
x <- inspect_imb(starwars)
show_plot(x)

# memory usage barplot
x <- inspect_mem(starwars)
show_plot(x)

# missingness barplot
x <- inspect_na(starwars)
show_plot(x)

# histograms for numeric columns
x <- inspect_num(starwars)
show_plot(x)

# barplot of column types
x <- inspect_types(starwars)
show_plot(x)
# }

Run the code above in your browser using DataLab