first_char {acroname} | R Documentation |
This helper function will extract the first character from a string. The element may be a letter, number, or special character but will be coerced to a character vector in the output.
first_char(string)
string |
Character vector from which the first character will be extracted |
Character vector with the first character from each element in the vector passed to the input "string" argument. This value will be the same length as the original vector.
first_char("purple")
first_char(c("purple","rain"))
first_char(c("nothing","compares","2u"))