dataset_visualize | R Documentation |
Generates a visual report of a dataset in an HTML bookdown document, with summary figures and statistics for each variable. The report outputs can be grouped by a categorical variable.
dataset_visualize(
dataset = tibble(id = as.character()),
bookdown_path,
data_dict = data_dict_extract(dataset),
group_by = NULL,
valueType_guess = FALSE,
taxonomy = NULL,
dataset_name = .dataset_name,
dataset_summary = .summary_var,
.summary_var = NULL,
.dataset_name = NULL
)
dataset |
A dataset object. |
bookdown_path |
A character string identifying the folder path where the bookdown report files will be saved. |
data_dict |
A list of data frame(s) representing metadata of the input dataset. Automatically generated if not provided. |
group_by |
A character string identifying the column in the dataset to use as a grouping variable. Elements will be grouped by this column. |
valueType_guess |
Whether the output should include a more accurate valueType that could be applied to the dataset. FALSE by default. |
taxonomy |
An optional data frame identifying a variable classification schema. |
dataset_name |
A character string specifying the name of the dataset
(used internally in the function |
dataset_summary |
A list which identifies an existing
summary produced by |
.summary_var |
|
.dataset_name |
A dataset is a data table containing variables. A dataset object is a data frame and can be associated with a data dictionary. If no data dictionary is provided with a dataset, a minimum workable data dictionary will be generated as needed within relevant functions. Identifier variable(s) for indexing can be specified by the user. The id values must be non-missing and will be used in functions that require it. If no identifier variable is specified, indexing is handled automatically by the function.
A data dictionary contains the list of variables in a dataset and metadata
about the variables and can be associated with a dataset. A data dictionary
object is a list of data frame(s) named 'Variables' (required) and
'Categories' (if any). To be usable in any function, the data frame
'Variables' must contain at least the name
column, with all unique and
non-missing entries, and the data frame 'Categories' must contain at least
the variable
and name
columns, with unique combination of
variable
and name
.
The valueType is a declared property of a variable that is required in certain functions to determine handling of the variables. Specifically, valueType refers to the OBiBa data type of a variable. The valueType is specified in a data dictionary in a column 'valueType' and can be associated with variables as attributes. Acceptable valueTypes include 'text', 'integer', 'decimal', 'boolean', datetime', 'date'. The full list of OBiBa valueType possibilities and their correspondence with R data types are available using valueType_list. The valueType can be used to coerce the variable to the corresponding data type.
A taxonomy is a classification schema that can be defined for variable
attributes. A taxonomy is usually extracted from an
Opal environment, and a
taxonomy object is a data frame that must contain at least the columns
taxonomy
, vocabulary
, and terms
. Additional details about Opal
taxonomies are
available online.
A folder containing files for the bookdown site. To open the bookdown site
in a browser, open 'docs/index.html', or use bookdown_open()
with the
folder path.
bookdown_open()
as_category()
{
# You can use our demonstration files to run examples
library(fs)
library(dplyr)
dataset <- madshapR_DEMO$dataset_TOKYO['height'] %>% slice(0)
dataset_summary <- madshapR_DEMO$`dataset_summary`
if(dir_exists(tempdir())) dir_delete(tempdir())
bookdown_path <- tempdir()
dataset_visualize(
dataset,
dataset_summary = dataset_summary,
bookdown_path = bookdown_path)
# To open the file in browser, open 'bookdown_path/docs/index.html'.
# Or use bookdown_open(bookdown_path) function.
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.