Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

function
r
communitycreator

What is the is.name() function in R?

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In R, the is.name() function is used to return a logical value, TRUE or FALSE, indicating whether an argument passed to it is a name class object.

Note: A name class object has the class "name".

Syntax

is.name(x)
Syntax for the is.name() function

Parameter

This function takes the argument x, which represents the value we want to check.

Return value

This function returns TRUE if the argument passed to it is a name. Otherwise, it returns FALSE.

Example

# cretating R objects
a <- as.name("Theo")
b <- as.integer(2)
# impementing the is.name() function
is.name(a)
is.name(b)
Implementing the is.name() function

Explanation

  • Line 2: We create a variable, a, using the as.name() function. The as.name() function converts the object, a, to a name class object.
  • Line 3: We use the as.integer() function to create another variable b.
  • Line 6–7: We implement the is.name() function on both variables to check if they are name class object or not.

RELATED TAGS

function
r
communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring