as_dossier | R Documentation |
Checks if an object is a valid dossier (list of datasets) and returns it
with the appropriate madshapR::class
attribute. This function mainly helps
validate inputs within other functions of the package but could be used to
check if a dossier is valid.
as_dossier(object)
object |
A potential dossier object to be coerced. |
A dossier is a named list containing at least one data frame or more, each of them being datasets. The name of each tibble will be use as the reference name of the dataset.
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 list of data frame(s) with madshapR::class
'dossier'.
For a better assessment, please use dataset_evaluate()
.
{
# use madshapR_DEMO provided by the package
library(dplyr)
library(stringr)
###### Example 1: a dataset list is a dossier by definition.
dossier <-
as_dossier(madshapR_DEMO[str_detect(names(madshapR_DEMO),"dataset_TOKYO")])
glimpse(dossier)
###### Example 2: any list of data frame can be a dossier by
# definition.
glimpse(as_dossier(list(dataset_1 = iris, dataset_2 = mtcars)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.