Visualization

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(descriptr)
library(dplyr)

Introduction

In this document, we will introduce you to functions for generating different types of plots.

Data

We have modified the mtcars data to create a new data set mtcarz. The only difference between the two data sets is related to the variable types.

str(mtcarz)

Continuous Data

The following functions will create plots for all or subset of continuous variables in the data set.

Histograms

ds_plot_histogram(mtcarz)

Density Plots

ds_plot_density(mtcarz)

Box Plots

ds_plot_box_single(mtcarz)

Scatter Plots

ds_plot_scatter(mtcarz, mpg, disp, hp)

Categorical Data

The following functions will create plots for all or subset of categorical variables in the data set.

Bar Plot

ds_plot_bar(mtcarz)

Stacked Bar Plot

ds_plot_bar_stacked(mtcarz, cyl, gear, am)

Grouped Bar Plot

ds_plot_bar_grouped(mtcarz, cyl, gear, am)

Grouped Box Plots

ds_plot_box_group(mtcarz, cyl, gear, mpg, disp)


Try the descriptr package in your browser

Any scripts or data that you put into this service are public.

descriptr documentation built on Dec. 15, 2020, 5:37 p.m.