Learn R Programming

cayleyR (version 0.2.1)

convert_digits: Convert String to Integer Vector of Digits

Description

Parses a string of digits or space-separated numbers into an integer vector. Useful for converting operation sequences or state representations.

Usage

convert_digits(s)

Value

Integer vector of parsed numbers

Arguments

s

Character string. Either a string of single digits (e.g., "123") or space-separated numbers (e.g., "1 2 3" or "10 11 12").

Examples

Run this code
convert_digits("123")
convert_digits("1 5 4 3 2")
convert_digits("10 11 12 13")

Run the code above in your browser using DataLab