Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the class defined in the following R code?
y<-c(FALSE,2)

What is the class defined in the following R code?
y<-c(FALSE,2)
a) Character
b) Numeric
c) Logical
d) Integer

Answer: b
Explanation: Numeric and FALSE is executed as 0. It is somewhat different from other programming languages. Console will give a class as Numeric. A vector can only contain objects of the same class. A list is represented as a vector but can contain objects of different classes.

Join The Discussion