Skip to contents

to

to()
Convert a value to a target type

character vectors

are_chr_ish() is_chr_ish() are_character_ish() is_character_ish()
Check if an object can be safely coerced to character
specify_chr() specify_chr_scalar() specify_character() specify_character_scalar()
Create a specified character stabilizer function
stabilize_chr() stabilize_character() stabilise_chr() stabilise_character()
Coerce to character with additional checks
stabilize_chr_scalar() stabilize_character_scalar() stabilise_chr_scalar() stabilise_character_scalar()
Coerce to length-1 character with additional checks
to_chr() to_character()
Coerce to character
to_chr_scalar() to_character_scalar()
Coerce to length-1 character
regex_must_match() regex_must_not_match()
Create a regex matching rule

double vectors

are_dbl_ish() is_dbl_ish() are_double_ish() is_double_ish()
Check if an object can be safely coerced to double
specify_dbl() specify_dbl_scalar() specify_double() specify_double_scalar()
Create a specified double stabilizer function
stabilize_dbl() stabilize_double() stabilise_dbl() stabilise_double()
Coerce to double with additional checks
stabilize_dbl_scalar() stabilize_double_scalar() stabilise_dbl_scalar() stabilise_double_scalar()
Coerce to length-1 double with additional checks
to_dbl() to_double()
Coerce to double
to_dbl_scalar() to_double_scalar()
Coerce to length-1 double

factors

are_fct_ish() is_fct_ish() are_factor_ish() is_factor_ish()
Check if an object can be safely coerced to a factor
specify_fct() specify_fct_scalar() specify_factor() specify_factor_scalar()
Create a specified factor stabilizer function
stabilize_fct() stabilize_factor() stabilise_fct() stabilise_factor()
Coerce to factor with additional checks
stabilize_fct_scalar() stabilize_factor_scalar() stabilise_fct_scalar() stabilise_factor_scalar()
Coerce to length-1 factor with additional checks
to_fct() to_factor()
Coerce to factor
to_fct_scalar() to_factor_scalar()
Coerce to length-1 factor

integer vectors

are_int_ish() is_int_ish() are_integer_ish() is_integer_ish()
Check if an object can be safely coerced to integer
specify_int() specify_int_scalar() specify_integer() specify_integer_scalar()
Create a specified integer stabilizer function
stabilize_int() stabilize_integer() stabilise_int() stabilise_integer()
Coerce to integer with additional checks
stabilize_int_scalar() stabilize_integer_scalar() stabilise_int_scalar() stabilise_integer_scalar()
Coerce to length-1 integer with additional checks
to()
Convert a value to a target type
to_date()
Coerce to date
to_dttm() to_datetime()
Coerce to date-time
to_dur() to_duration()
Coerce to a duration
to_int() to_integer()
Coerce to integer
to_int_scalar() to_integer_scalar()
Coerce to length-1 integer
to_time()
Coerce to time-of-day

logical vectors

are_lgl_ish() is_lgl_ish() are_logical_ish() is_logical_ish()
Check if an object can be safely coerced to logical
specify_lgl() specify_lgl_scalar() specify_logical() specify_logical_scalar()
Create a specified logical stabilizer function
stabilize_lgl() stabilize_logical() stabilise_lgl() stabilise_logical()
Coerce to logical with additional checks
stabilize_lgl_scalar() stabilize_logical_scalar() stabilise_lgl_scalar() stabilise_logical_scalar()
Coerce to length-1 logical with additional checks
to_lgl() to_logical()
Coerce to logical
to_lgl_scalar() to_logical_scalar()
Coerce to length-1 logical

data frames

specify_df() specify_data_frame()
Create a specified data frame stabilizer function
stabilize_df() stabilise_df() stabilize_data_frame() stabilise_data_frame()
Ensure a data frame meets expectations
to_df() to_data_frame()
Ensure a data frame meets expectations

functions

are_fn_ish() are_function_ish() is_fn_ish() is_function_ish()
Check if an object can be safely coerced to a function
to_fn() to_function()
Coerce to a function
to()
Convert a value to a target type
to_lst() to_list()
Ensure a list meets expectations

lists

specify_lst() specify_list()
Create a specified list stabilizer function
stabilize_lst() stabilize_list() stabilise_lst() stabilise_list()
Ensure a list meets expectations
to_lst() to_list()
Ensure a list meets expectations
assert_present()
Require a value to be non-NULL

dates and times

specify_date() specify_date_scalar()
Create a specified date stabilizer function
specify_dttm() specify_dttm_scalar() specify_datetime() specify_datetime_scalar()
Create a specified datetime stabilizer function
stabilize_date() stabilise_date()
Coerce to date with additional checks
stabilize_date_scalar() stabilise_date_scalar()
Coerce to length-1 date with additional checks
stabilize_dttm() stabilise_dttm() stabilize_datetime() stabilise_datetime()
Coerce to date-time with additional checks
stabilize_dttm_scalar() stabilise_dttm_scalar() stabilize_datetime_scalar() stabilise_datetime_scalar()
Coerce to length-1 date-time with additional checks
to_date()
Coerce to date
to_date_scalar()
Coerce to length-1 date
to_dttm() to_datetime()
Coerce to date-time
to_dttm_scalar() to_datetime_scalar()
Coerce to length-1 date-time
specify_time() specify_time_scalar()
Create a specified time-of-day stabilizer function
stabilize_time() stabilise_time()
Coerce to time-of-day with additional checks
stabilize_time_scalar() stabilise_time_scalar()
Coerce to length-1 time-of-day with additional checks
to_dur() to_duration()
Coerce to a duration
to_time()
Coerce to time-of-day
to_time_scalar()
Coerce to length-1 time-of-day
specify_dur() specify_dur_scalar() specify_duration() specify_duration_scalar()
Create a specified duration stabilizer function
stabilize_dur() stabilise_dur() stabilize_duration() stabilise_duration()
Coerce to duration with additional checks
stabilize_dur_scalar() stabilise_dur_scalar() stabilize_duration_scalar() stabilise_duration_scalar()
Coerce to length-1 duration with additional checks
to_dur_scalar()
Coerce to length-1 duration

any type

stabilize_any_of() stabilise_any_of() to_any_of()
Try to coerce or validate x as one of several types

generic args

object_type()
Identify the class, type, etc of an object
stabilize_arg() stabilize_arg_scalar()
Ensure an object meets expectations

conditions

ignore_stbl_error()
Ignore a stbl error class
replace_stbl_error()
Replace a stbl error with a custom message
pkg_abort()
Signal an error with standards applied
expect_pkg_error_classes()
Test package error classes
expect_pkg_error_snapshot()
Snapshot-test a package error
pkg_warn()
Signal a warning with standards applied
expect_pkg_warning_classes()
Test package warning classes
expect_pkg_warning_snapshot()
Snapshot-test a package warning
pkg_inform()
Signal a message with standards applied
expect_pkg_message_classes()
Test package message classes
expect_pkg_message_snapshot()
Snapshot-test a package message