Utility functions for checking formats and alignments.
Arguments
- x
- ( - stringor- function)
 format string or an object returned by- sprintf_format()
- stop_otherwise
- ( - flag)
 whether an error should be thrown if- xis not a valid format.
- algn
- ( - character)
 a character vector that indicates the requested cell alignments.
Value
- is_valid_formatreturns- TRUEif- xis- NULL, a supported format string, or a function, and- FALSEotherwise.
- check_alignsreturns- TRUEif the provided alignments are supported, otherwise, an error is thrown.
Examples
is_valid_format("xx.x")
#> [1] TRUE
is_valid_format("fakeyfake")
#> [1] FALSE
check_aligns(c("decimal", "dec_right"))