R Programming MCQ Questions And Answers - Functions

This section focuses on "Functions" in R Programming. These Multiple Choice Questions (MCQ) should be practiced to improve the R Programming skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. An R function is created by using the keyword?

A. fun
B. function
C. declare
D. extends

View Answer


2. What will be output for the following code?

print(mean(25:82))

A. 1526
B. 53.5
C. 50.5
D. 55

View Answer


3. Point out the wrong statement?

A. Functions in R are “second class objects”
B. The writing of a function allows a developer to create an interface to the code, that is explicitly specified with a set of parameters
C. Functions provides an abstraction of the code to potential users
D. Writing functions is a core activity of an R programmer

View Answer


4. What will be output for the following code?

> paste("a", "b", se = ":")

A. a+b
B. a:b
C. a-b
D. None of the above

View Answer


5. Which function in R language is used to find out whether the means of 2 groups are equal to each other or not?

A. f.tests ()
B. l.tests ()
C. t.tests ()
D. p.tests ()

View Answer


6. What will be the output of log (-5.8) when executed on R console?

A. NA
B. NAN
C. 0.213
D. Error

View Answer


7. Which function is preferred over sapply as vapply allows the programmer to specific the output type?

A. Lapply
B. Japply
C. Vapply
D. Zapply

View Answer


8. How will you check if an element is present in a vector?

A. Match()
B. Dismatch()
C. Mismatch()
D. Search()

View Answer


9. You can check to see whether an R object is NULL with the _________ function.

A. is.null()
B. is.nullobj()
C. null()
D. as.nullobj()

View Answer


10. In the base graphics system, which function is used to add elements to a plot?

A. Boxplot()
B. Text()
C. Treat()
D. Both A and B

View Answer





Discussion



* You must be logged in to add comment.