Description Usage Arguments Details Value Examples
View source: R/Data_Dictionary.R
Create a data dictionary object which holds information on the columns of a data.frame-like object.
1 |
df |
The data.frame-like object to calculate information for (should be a name, not an expression). |
tableMode |
What mode to use for tabulating each column (see |
verbose |
How verbose you want the function to be (higher prints more information) (integer scalar). |
The df
parameter should be the name of a data.frame-like object, as opposed to an expression.
E.g. call the function as dataDict(mtcars)
, instead of dataDict(as_tibble(mtcars))
.
This will allow for more functionality, and will help avoid errors, especially when lazy table mode is active.
If you want to pass an expression, simple ones should work, but do so at your own risk.
tableMode
can be one of three values: c(TRUE, FALSE, "lazy").
Lazy table mode means that columns are not tabulated until requested.
When they are tabulated, they can be done only when accessed (tableMode = "lazy"
),
or all together up front (tableMode = true
).
This setting can be deactivated entirely (tableMode = FALSE
), but this is not suggested.
This setting is useful since tabulation can take a long time for large datasets.
If verbose > 0
(or verbose != FALSE
), a message will be printed out when lazy table mode is active,
as well as when df
is passed as an expression.
If verbose > 1
, a message will be printed out saying what object the dataDict
is based on.
A dataDict
object.
1 2 3 4 5 6 7 8 9 10 11 | dd1 <- dataDict(mtcars)
dd2 <- dataDict(mtcars, tableMode = "lazy")
dd3 <- dataDict(mtcars, tableMode = TRUE)
dd5 <- dataDict(mtcars, tableMode = FALSE)
dd4 <- dataDict(mtcars, tableMode = "lazy", verbose = 0)
dd4 <- dataDict(mtcars, tableMode = TRUE, verbose = 0)
dd4 <- dataDict(mtcars, tableMode = FALSE, verbose = 0)
# The line below works, since the expression is rather simple, but should be avoided
# It is better to declare use something like: `df <- as_tibble(mtcars); dd <- dataDict(df)`
dd <- dataDict(tibble::as_tibble(mtcars))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.