Learn R Programming

cards (version 0.5.1)

.check_fmt_string: Check 'xx' Format Structure

Description

A function that checks a single string for consistency. String must begin with 'x' and only consist of x's, a single period or none, and may end with a percent symbol.

If string is consistent, TRUE is returned. Otherwise an error.

Usage

.check_fmt_string(x, variable, stat_name)

Value

a logical

Arguments

x

(string)
string to check

variable

(character)
the variable whose statistic is to be formatted

stat_name

(character)
the name of the statistic that is to be formatted

Examples

Run this code
cards:::.check_fmt_string("xx.x") # TRUE
cards:::.check_fmt_string("xx.x%") # TRUE

Run the code above in your browser using DataLab