str_date: Functions to preform string operations which do not currently...

View source: R/str_functions.R

str_dateR Documentation

Functions to preform string operations which do not currently exist in stringr.

Description

str_date returns the system's idea of the date as a character string.

Usage

str_date(time = TRUE, tz = TRUE, underscore = FALSE)

str_rm_non_ascii(x)

str_trim_length(string, length)

str_to_underscore(x)

str_trim_many_spaces(x)

str_chop(string, n)

str_drop_xml_tags(string)

str_rm_round_brackets(x)

str_rm_square_brackets(x)

str_extract_digits(x, as.numeric = TRUE)

str_sql_quote(x, collapse = ",")

str_unique_characters(x)

str_nth_character(x, n)

str_create_na(x)

str_thousands_separator(x, sep = " ")

str_note_to_title(x, sep = "_")

str_note_to_sentence(x, sep = "_")

str_to_general(x)

str_filter(x, pattern, ignore.case = FALSE, invert = FALSE)

str_parse_html_codes(x)

str_utf8_to_integer(x)

str_integer_to_utf8(x)

str_insert(x, n, sep)

str_extract_characters(x)

str_english_currency_format(x, sep = " ", currency = NA)

str_url_decode(x)

Arguments

time, tz, underscore, length, n, as.numeric, collapse, sep, pattern, ignore.case, invert, currency

Function specific options.

x, string

Input string.

Details

str_rm_non_ascii removes all non-ASCII characters from a string.

str_trim_length trims strings to a certain length of characters.

str_to_underscore converts CamelCase and period.separated strings to lowercase underscore_separated strings.

str_trim_many_spaces will remove excess spaces between words in a string.

str_chop will chop a string into a vector of fixed-width lengths.

str_drop_xml_tags removes XML tags from strings.

str_extract_digits will extract digits/numbers from a string and convert to a numeric data class if desired.

str_sql_quote will add single quotes can collapse string vectors, a common step for building SQL statements.

str_unique_characters will find unique characters in a string.

str_nth_character will return single character(s) from position(s) for a string.

str_create_na will convert "NA", "", and " " into NA.

str_thousands_separator will add thousands separators to a string or numeric vector.

str_note_to_title will format a normalised note such as "meeting_in_auckland" to a note with title-case.

str_note_to_sentence will format a normalised note such as "testing_the_things" to a note with the first character capitalised with all other characters lower-case.

str_to_general will make a "general" string and will transliterate special characters to avoid issues such as matching for a join.

str_filter will filter a character vector to match a pattern, or drop elements which match a pattern.

str_parse_html_codes will parse HTML character codes into text.

str_utf8_to_integer will map a character vector to the UTF-8 integer code points.

str_integer_to_utf8 will map an integer vector to UTF-8 charcters.

str_insert will insert characters in location within a string.

str_extract_characters will extract characters and drop digits.

str_english_currency_format will format a number for currency printing.

Author(s)

Stuart K. Grange


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.