Learn R Programming

chronicle (version 0.1.0)

report_columns: HTML interactive report detailing each column on a table

Description

Creates an Rmarkdown report plotting each column of a dataset. Categorical columns are plotted in bar plots, and numerical columns are plotted in box plots. If 'by_column' is provided, these plots will be grouped by the values of that column

Usage

report_columns(
  dt,
  by_column = NULL,
  filename = NULL,
  author = "chronicle user",
  horizontal_bars = FALSE,
  sort_bars_value = FALSE,
  sort_bars_decreasingly = TRUE,
  prettydoc = TRUE,
  prettydoc_theme = "leonids",
  highlight = "github",
  number_sections = TRUE,
  table_of_content = TRUE,
  table_of_content_depth = 1,
  fig_width = 11,
  fig_height = 5,
  directory = getwd(),
  keep_rmd = FALSE,
  render_html = TRUE
)

Arguments

dt

Table to be plotted.

by_column

Name of the colum to use as groups for all the other plots

filename

Name of the output file.

author

Author of the report.

horizontal_bars

Plot bars for categorical variables horizontally. Default is FALSE

sort_bars_value

Sort the bars by value. Default is FALSE.

sort_bars_decreasingly

Sort the bars decreasingly. Default is TRUE.

prettydoc

Whether or not to use prettydoc formatting on the html report. Default is TRUE.

prettydoc_theme

Name of the theme used on prettydoc. Default is cayman.

highlight

Rmarkdown highlight theming. Default is github highlighting.

number_sections

Whether or not to number the sections and subsections fo the report.

table_of_content

Whether or not to include a table fo content at the beginning of the report.

table_of_content_depth

The depth of sections and subsections to be displayed on the table of content.

fig_width

Set the global figure width or the rmarkdown file.

fig_height

Set the global figure height or the rmarkdown file.

directory

The directory in which to render the .html report

keep_rmd

Whether or not to keep the .Rmd file. Default is false.

render_html

Whether or not to render the report as an interactive hmtl file.

Value

Creates an HTML file with a plot for each column on the given table: a boxplot for each numerical variable, and a barplot for each categorical variable.

Examples

Run this code
# NOT RUN {
chronicle::report_columns(dt = iris,
                                    by_column = 'Species',
                                    horizontal_bars = TRUE,
                                    keep_rmd = TRUE)
          file.remove('iris_column_analysis.Rmd')
          file.remove('iris_column_analysis.html')
# }

Run the code above in your browser using DataLab