isCharLike | R Documentation |
Tests if an object can be treated as a character, to name something; as a date; as a grouping variable, has distinct values; or as a number.
isCharLike(x) isDateLike(x) isGroupLike(x) isNumberLike(x)
x |
any object. |
The function isCharLike
tests whether x
is of class "character"
or "factor." The function isDateLike
tests whether x
is of
class "Date" or "POSIXt." The function isGroupLike
tests whether
x
is of class "character" or "factor" or if x
is of type
"integer" or "logical." The function isNumberLike
tests whether
x
is of type "numeric" or of class "Date."
A logical value TRUE
if x
meets the criteria, or
FALSE
if it does not.
This function is most useful within other functions to control how that function handles a particular argument.
class
, is.numeric
,
is.factor
, is.character
,
is.integer
, is.logical
## The first should be FALSE and the second TRUE isCharLike(as.Date("2004-12-31")) isCharLike("32") ## The first should be FALSE and the second TRUE isDateLike(32) isDateLike(as.Date("2004-12-31")) ## The first should be FALSE and the second TRUE isGroupLike(as.Date("2004-12-31")) isGroupLike(32) ## The first should be FALSE and the second TRUE isNumberLike(as.Date("2004-12-31")) isNumberLike(32)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.