Open In App

Check if the Argument is a Name in R Programming - is.name() Function

Last Updated : 19 Jun, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
is.name() function in R Language is used to return TRUE if the argument is name else returns FALSE. The is.name() and is.symbol() functions are identical.
Syntax: is.name(x) Parameters: x: R object to be tested
Example 1: Python3
# R program to illustrate
# is.name() function

# Initializing a string
x <- "sample"

# Calling the is.name() function
# to check whether the argument is
# name or not
is.name(x)
Output:
[1] FALSE
Example 2: Python3
# R program to illustrate
# is.name() function

# Coercing the argument to a name
x <- as.name("sample")

# Calling the is.name() function
# to check whether the argument is
# name or not
is.name(x)
Output:
[1] TRUE

Next Article
Article Tags :

Similar Reads