1.

If the programmers want the output to be a data frame or a vector, then________ function is used.(a) Lapply(b) Sapply(c) Vapply(d) ZapplyI have been asked this question in my homework.My doubt is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming

Answer» CORRECT answer is (a) Lapply

Easiest EXPLANATION: If the programmers want the output to be a data frame or a vector, then sapply function is USED whereas if the programmer WANTS the output to be a LIST then lapply is used. vapply allows the programmer to specific the output type.


Discussion

No Comment Found

Related InterviewSolutions