Learn R Programming

tester (version 0.2.0)

is_dataframe: Is data frame

Description

is_dataframe tests if an object is a data frame
is_numeric_dataframe tests if an object is a numeric data frame
is_string_dataframe tests if an object is a string data frame
is_factor_dataframe tests if an object is a factor data frame
is_not_dataframe tests if an object is not a data frame

Arguments

x

an R object

Examples

Run this code
is_dataframe(iris) # TRUE
is_dataframe(1:10) # FALSE

is_numeric_dataframe(iris) # FALSE
is_numeric_dataframe(iris[,1:4]) # TRUE

DF = matrix(letters[1:24], 6, 4)
DF1 = data.frame(DF)
DF2 = data.frame(DF, stringsAsFactors=FALSE)

is_string_dataframe(DF1) # FALSE
is_string_dataframe(DF2) # TRUE

is_factor_dataframe(DF1) # TRUE
is_factor_dataframe(DF2) # FALSE

Run the code above in your browser using DataLab