detect_char: Detect a vector that might be of class character

Description Usage Arguments Value Examples

Description

Detect a vector that might be of class character

Usage

1
detect_char(x, convert = FALSE)

Arguments

x

a vector

convert

a logical value indicating whether to convert the vector into character if it is suspected by the function to be of class character. Default is FALSE

Value

If convert is TRUE, return converted vector of class character. Otherwise, return nothing but print corresponding messages

Examples

1
2
3
4
5
x <- as.factor(c("This", "is", "actually", "a", "sentence"))
class(x)
detect_char(x)
xnew <- detect_char(x, convert = TRUE)
class(xnew)

MaryHe/First-Package-of-Mary documentation built on May 7, 2019, 3:40 p.m.