Skip to contents

This is a helper function for data checks. It checks if a vector is of the desired type.

Usage

check_column_type(column, type)

Arguments

column

Vector.

type

Character. One of integer, numeric or character.

Value

TRUE if the vector is of specified type.

Examples

check_column_type(1:5, "integer")
#> [1] TRUE
check_column_type(paste0("test", 1:5), "character")
#> [1] TRUE
check_column_type(c(1:4, "notanumber"), "numeric")
#> [1] FALSE