Utility functions for checking formats and alignments.
Arguments
- x
either format string or an object returned by
sprintf_format- stop_otherwise
logical, if
xis not a format should an error be thrown- algn
vector of characters that indicates the requested cell alignments.
Value
is_valid_format:TRUEifxisNULL, a supported format string, or a function;FALSEotherwise.
check_aligns:TRUEif it passes the check.
Examples
is_valid_format("xx.x")
#> [1] TRUE
is_valid_format("fakeyfake")
#> [1] FALSE
check_aligns(c("decimal", "dec_right"))