Description Usage Arguments Details Value Author(s) See Also Examples
Determines the position(s) of a given character in a string variable. If the character is absent, NA is returned.
1 | pos.char(string, char)
|
string |
Character string |
char |
The character to position of which needs to be determined |
The function converts the string to a vector of characters. An alternative is to use which(strsplit(string, ”)[[1]]=='a'), where a is the character. That code determines all positions of the character in the character string.
The position is returned
Frans Willekens
printf
1 2 | string <- "tests"
pos.char(string,"s")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.