Section 13 R Atomic Class: Character
A character vector stores text information
A character vector is created by typing a character or string of characters enclosed by quotes.
R will look for an object with the same name if you miss the quotation marks for the character strings.
Expect an error whenever you forget your quotation marks; R will look for an object with the same name which may not exist.
Function to identify the object type:
class, typeof, mode
Other functions to check the object type as character:
is.character
13.1 Examples
<- "my"
x
xclass(x)
typeof(x)
mode(x)
is.character(x)
<- 'my text here '
y
yclass(y)
<- 'Sam'
z
zclass(z)
is.character(z)
<- 'Ten'
a
aclass(a)
is.character(a)
<- '10'
b
bclass(b)
is.character(b)
<- 'TRUE'
c
cclass(c)
is.character(c)