Check structure of a dataframe
check_dataframe_structure.Rd
This is a helper function for data checks. It checks if the dataframe df
contains all the columns
with names and types specified in structure
.
Examples
df <- data.frame(Col1 = 1:5, Col2 = paste0("test", 1:5))
structure <- data.frame(Colname = c("Col1", "Col2"), Coltype = c("integer", "character"))
check_dataframe_structure(df, structure)
#> [1] TRUE