Learn R Programming

mclm (version 0.2.7)

as_character: Coerce object to character

Description

This method turns its argument x, or at least part of the information in it, into a character vector.

Usage

as_character(x, ...)

# S3 method for default as_character(x, ...)

# S3 method for re as_character(x, ...)

# S3 method for tokens as_character(x, ...)

Value

Object of class character

Arguments

x

Object to coerce to character

...

Additional arguments

Examples

Run this code
(tks <- tokenize("The old man and the sea."))
as_character(tks) # turn 'tokens' object into character vector
as.character(tks) # alternative approach

as_character(1:10)
as.character(1:10)

regex <- re("(?xi) ^ .*")
as_character(regex) # turn 're' object into character vector
as.character(regex) # alternative approach

Run the code above in your browser using DataLab