This function is a wrapper around the functions dim
for the number of
rows and columns, names
for the variable names, df.head
for the
first rows, and df.tail
for the last rows of a data frame.
df.check(x, print = c("dim", "names", "head", "tail"), n = 4,
digits = 3, width = 20, row.names = TRUE, row.names.col = "gray2",
message = TRUE, message.col = "b.blue", check = TRUE, output = TRUE)
a data frame.
a character string or character vector indicating which
results to show on the console, i.e., "dim"
, for
the number of rows and number of columns, "names"
for the variable names, "head"
for the first rows
of the data frame, and "tail"
for the last rows
of the data frame.
a numeric value indicating the number of rows to be printed on the console.
a numeric value indicating the maximum number of decimal places to be used.
a numeric value indicating the maximum width of the character strings in the vector.
logical: if TRUE
, row names of the data frame are
printed on the console.
a character string indicating the text color for the row
names, see color
argument of the chr.color
function.
logical: if TRUE
, number of remaining rows and
columns are printed on the console.
a character string indicating the text color for the
number of remaining rows and columns printed on the
console, see color
argument of the
chr.color
function.
logical: if TRUE
(default), argument specification
is checked.
logical: if TRUE
(default), output is shown on the
console.
Takuya Yanagida
Note that this function only provides a basic data check suitable for checking a data frame after importing data into R and is not designed to offer a thorough data check (e.g., identifying duplicate IDs or inconsistencies in the data).
df.head
, df.head
,
# Example 1: Check data frame mtcars
df.check(mtcars)
Run the code above in your browser using DataLab