check_posixct_type: Check for POSIXct Type

View source: R/check_posixct_type.R

check_posixct_typeR Documentation

Check for POSIXct Type

Description

This function checks if the specified column in the provided dataframe has a POSIXct type. It uses the checkmate::assert_posixct function to perform the assertion.

Usage

check_posixct_type(column_name, dataframe, column_prefix = NULL, ...)

Arguments

column_name

A character vector or string with the column name to be tested.

dataframe

The dataframe that contains the column.

column_prefix

Default is NULL. If provided, this text is prepended to the variable name in the assertion message.

...

The remaining parameters are passed to the function assert_posixct.

See Also

Other assertions: check_no_duplicates_in_group(), check_numeric_or_integer_type()

Other tests: check_double_columns(), check_no_duplicates_in_group(), check_numeric_or_integer_type(), duplicates_in_column(), test_all_equal()

Examples

# Create a dataframe with a POSIXct column
dataframe <- data.frame(date = as.POSIXct("2023-10-04"))
# Check the POSIXct type of the 'date' column
check_posixct_type("date", dataframe)

vvauditor documentation built on May 29, 2024, 12:20 p.m.