Learn R Programming

misty (version 0.7.0)

df.check: Data Check

Description

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.

Usage

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)

Arguments

x

a data frame.

print

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.

n

a numeric value indicating the number of rows to be printed on the console.

digits

a numeric value indicating the maximum number of decimal places to be used.

width

a numeric value indicating the maximum width of the character strings in the vector.

row.names

logical: if TRUE, row names of the data frame are printed on the console.

row.names.col

a character string indicating the text color for the row names, see color argument of the chr.color function.

message

logical: if TRUE, number of remaining rows and columns are printed on the console.

message.col

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.

check

logical: if TRUE (default), argument specification is checked.

output

logical: if TRUE (default), output is shown on the console.

Author

Takuya Yanagida

Details

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).

See Also

df.head, df.head,

Examples

Run this code
# Example 1: Check data frame mtcars
df.check(mtcars)

Run the code above in your browser using DataLab