View source: R/report_tbl_dbi.R
eda_web_report.tbl_dbi | R Documentation |
The eda_web_report() report the information of exploratory data analysis for the DBMS table through tbl_dbi
## S3 method for class 'tbl_dbi'
eda_web_report(
.data,
target = NULL,
output_file = NULL,
output_dir = tempdir(),
browse = TRUE,
title = "EDA",
subtitle = deparse(substitute(.data)),
author = "dlookr",
title_color = "gray",
logo_img = NULL,
create_date = Sys.time(),
theme = c("orange", "blue")[1],
sample_percent = 100,
in_database = FALSE,
collect_size = Inf,
as_factor = TRUE,
...
)
.data |
a tbl_dbi. |
target |
character. target variable. |
output_file |
name of generated file. default is NULL. |
output_dir |
name of directory to generate report file. default is tempdir(). |
browse |
logical. choose whether to output the report results to the browser. |
title |
character. title of report. default is "EDA Report". |
subtitle |
character. subtitle of report. default is name of data. |
author |
character. author of report. default is "dlookr". |
title_color |
character. color of title. default is "gray". |
logo_img |
character. name of logo image on top right. |
create_date |
Date or POSIXct, character. The date on which the report is generated. The default value is the result of Sys.time(). |
theme |
character. name of theme for report. support "orange" and "blue". default is "orange". |
sample_percent |
numeric. Sample percent of data for performing EDA. It has a value between (0, 100]. 100 means all data, and 5 means 5% of sample data. This is useful for data with a large number of observations. |
in_database |
Specifies whether to perform in-database operations. If TRUE, most operations are performed in the DBMS. if FALSE, table data is taken in R and operated in-memory. Not yet supported in_database = TRUE. |
collect_size |
a integer. The number of data samples from the DBMS to R. Applies only if in_database = FALSE. |
as_factor |
logical. whether to convert to factor when importing a character type variable from DBMS table into R. |
... |
arguments to be passed to methods. |
Generate generalized EDA report automatically. This feature is useful for EDA of data with many variables, rather than data with fewer variables.
No return value. This function only generates a report.
Reported from the EDA is as follows.
Overview
Data Structures
Data Types
Job Information
Univariate Analysis
Descriptive Statistics
Normality Test
Bivariate Analysis
Compare Numerical Variables
Compare Categorical Variables
Multivariate Analysis
Correlation Analysis
Correlation Matrix
Correlation Plot
Target based Analysis
Grouped Numerical Variables
Grouped Categorical Variables
Grouped Correlation
eda_web_report.data.frame
.
# If you have the 'DBI' and 'RSQLite' packages installed, perform the code block:
if (FALSE) {
library(dplyr)
# Generate data for the example
heartfailure2 <- heartfailure
heartfailure2[sample(seq(NROW(heartfailure2)), 20), "platelets"] <- NA
heartfailure2[sample(seq(NROW(heartfailure2)), 5), "smoking"] <- NA
# connect DBMS
con_sqlite <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# copy heartfailure2 to the DBMS with a table named TB_HEARTFAILURE
copy_to(con_sqlite, heartfailure2, name = "TB_HEARTFAILURE", overwrite = TRUE)
# reporting the diagnosis information -------------------------
# create pdf file. file name is EDA_Report.html
con_sqlite %>%
tbl("TB_HEARTFAILURE") %>%
eda_web_report(target = "death_event")
# create pdf file. file name is EDA.html, and collect size is 250
con_sqlite %>%
tbl("TB_HEARTFAILURE") %>%
eda_web_report(collect_size = 250, output_file = "EDA.html")
# Disconnect DBMS
DBI::dbDisconnect(con_sqlite)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.