Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 115

Other string functions

Оглавление

 nchar(): returns the number of characters in a string

nchar()

 toupper(): puts the string in uppercase

toupper()

 tolower(): puts the string in lowercase

tolower()

 substring(x,first,last): returnsa substring from x starting with the “first” and ending with the “last”

substring()

 strsplit(x,split): splitthe elements of a vector into substrings according to matches of a substring “split.”there is also a family of search functions: grep(),

strsplit()

grep()

grepl(),

grepl()

regexpr(),

regexpr()

gregexpr(),

gregexpr()

and regexec()

regexec()

that supply powerful search and replace capabilities.

sub()

sub()

will replace the first of all matches and gsub()

gsub()

will replace all matches.

The Big R-Book

Подняться наверх