assertive.strings v0.0-3

0

Monthly downloads

0th

Percentile

Assertions to Check Properties of Strings

A set of predicates and assertions for checking the properties of strings. This is mainly for use by other package developers who want to include run-time testing features in their own packages. End-users will usually want to use assertive directly.

Readme

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Is the package on CRAN? SemaphoreCI Build Status AppVeyor Build Status

assertive.strings

A set of predicates and assertions for checking the properties of strings. Most of the documentation is on the assertive page. End-users will usually want to use assertive directly.

Installation

To install the stable version, type:

install.packages("assertive.strings")

To install the development version, you first need the devtools package.

install.packages("devtools")

Then you can install the assertive.strings package using

library(devtools)
install_bitbucket("richierocks/assertive.strings")

Predicates

is_empty_character, is_non_empty_character, is_missing_or_empty_character, and is_non_missing_nor_empty_character check for empty and missing (or not) character vectors.

is_an_empty_string, is_a_non_empty_string, is_a_missing_or_empty_string, and is_a_non_missing_nor_empty_string do the same, for single strings.

is_numeric_string checks for strings that contain numbers.

is_single_character checks for single characters.

is_matching_fixed, is_matching_regex, is_not_matching_fixed, and is_not_matching_regex all check whether a string matches a pattern or not.

Assertions

Predicates that return a vector have two corresponding assertions. For example, is_numeric_string has assert_all_are_numeric_strings and assert_any_are_numeric_strings.

Predicates returning a single logical value have one corresponding assertion. For example, is_an_empty_string has assert_is_an_empty_string.

Utils

character_to_list_of_integer_vectors converts a character vector of numbers to a list of integer vectors.

Functions in assertive.strings

Name Description
recycle Recycle arguments
assert_all_are_numeric_strings Does the string contain a number/logical value?
matches_regex Does the input match the regular expression?
assert_all_are_empty_character Does the input contain empty or missing strings?
character_to_list_of_integer_vectors Convert a character vector to a list of integer vectors
assert_all_are_matching_fixed Does the string match a pattern?
create_regex Create a regex from components.
assert_all_are_single_characters Is the input a single character?
strip_invalid_chars Removes invalid characters from a string.
d Create regex for repeated digits
No Results!

Last month downloads

Details

Type Package
Date 2016-03-08
URL https://bitbucket.org/richierocks/assertive.strings
BugReports https://bitbucket.org/richierocks/assertive.strings/issues
License GPL (>= 3)
LazyLoad yes
LazyData yes
Acknowledgments Development of this package was partially funded by the Proteomics Core at Weill Cornell Medical College in Qatar . The Core is supported by 'Biomedical Research Program' funds, a program funded by Qatar Foundation.
RoxygenNote 5.0.1
NeedsCompilation no
Packaged 2016-05-10 05:36:35 UTC; rjc2003
Repository CRAN
Date/Publication 2016-05-10 10:14:32

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/assertive.strings)](http://www.rdocumentation.org/packages/assertive.strings)