R - Character type

1 - About

A vector containing character values.

3 - Example

  • One
> v = "My Name";
> class(v)
[1] "character"
  • List
> v <- c("My Name","Is","Nico")
> class(v)
[1] "character"

4 - Management

4.1 - Counting the number of occurrence

library(stringr)
str_count("/mt/path", "/")
[1] 2

4.2 - Concatenate

Concatenate vectors after converting to character.

paste("Hello", "world", sep=" ")

where:

  • sep is the separator character between the arguments

4.3 - Escape \ Quotes

  • Bookmark "R - Character type" at del.icio.us
  • Bookmark "R - Character type" at Digg
  • Bookmark "R - Character type" at Ask
  • Bookmark "R - Character type" at Google
  • Bookmark "R - Character type" at StumbleUpon
  • Bookmark "R - Character type" at Technorati
  • Bookmark "R - Character type" at Live Bookmarks
  • Bookmark "R - Character type" at Yahoo! Myweb
  • Bookmark "R - Character type" at Facebook
  • Bookmark "R - Character type" at Yahoo! Bookmarks
  • Bookmark "R - Character type" at Twitter
  • Bookmark "R - Character type" at myAOL
r/character.txt ยท Last modified: 2017/01/19 11:26 by gerardnico