Learn R Programming

seqinr (version 4.2-36)

s2c: conversion of a string into a vector of chars

Description

This is a simple utility function to convert a single string such as "BigBang" into a vector of chars such as c("B", "i", "g", "B", "a", "n", "g").

Usage

s2c(string)

Value

a vector of chars. If supplied argument is not a single string, a warning is issued and NA returned.

Arguments

string

a string of chars

Author

J.R. Lobry

References

citation("seqinr")

See Also

c2s

Examples

Run this code
stopifnot(all(s2c("BigBang") == c("B", "i", "g", "B", "a", "n", "g")))

Run the code above in your browser using DataLab