Package 'llinyn'

Title: A Few Esoteric String Operations
Description: A few esoteric string operations in R.
Authors: Matthew Henderson [aut, cre]
Maintainer: Matthew Henderson <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2024-11-07 05:42:45 UTC
Source: https://github.com/MHenderson/llinyn

Help Index


Match, Parse and Format Timestamps from Text

Description

This function reads and parses timestamps from text and then outputs a differently formatted string representing the same timestamp.

Usage

extract_time_label(text)

Arguments

text

Input text.

Value

A formatted timestamp string.


Chop a String of Text to a Specific Width

Description

Chop a String of Text to a Specific Width

Usage

gqg(x, textwidth)

Arguments

x

A string.

textwidth

Desired width of output strings.

Value

A string with more newline characters.


Chop a String of Text to a Specific Width

Description

Chop a String of Text to a Specific Width

Usage

gqg_paragraph(s, textwidth)

Arguments

s

A string.

textwidth

Desired width of output strings.

Value

A string with more newline characters.


Locate Last Space Before a Space in a String

Description

Locate Last Space Before a Space in a String

Usage

locate_last_space_before(s, x)

Arguments

s

A string.

x

An index.

Value

The position of the last space character in s before x.


Escape A Few Things

Description

Replace certain characters in a string with escaped versions of those same characters for the benefit of LaTeX.

Usage

repair_latex_string(x)

Arguments

x

A text string.

Value

A text string with some escaped characters.


Replace a Character at a Location in a String

Description

Replace a Character at a Location in a String

Usage

replace_at_i(s, i, x = "\n")

Arguments

s

A string.

i

An index.

x

A character.

Value

The string s but with character x inserted at position i.


Remove Datetime Strings from Text

Description

Removes all datetime headings like "% Tue 3 Mar 09:20:25 GMT 2020".

Usage

strip_time_headings(text)

Arguments

text

A string of text, possibly containing datetime headings.

Value

The input string with all datetime headings removed.


Convert a Date Into Text.

Description

This takes a ymd (e.g. 2024/09/01) and returns the same date in text format (e.g. Sunday 1 September 2024).

Usage

ymd_text_format(ymd)

Arguments

ymd

A date in ymd format.

Value

A date string.