1.

Which function is more verbose?(a) Lapply(b) Japply(c) Vapply(d) ZapplyThe question was posed to me in an interview for internship.The question is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming

Answer»

The correct ANSWER is (c) Vapply

To explain: If a programmer wants the output to be a LIST then lapply is used. vapply allows the programmer to specific the output TYPE. The DISADVANTAGE of using vapply is that it is very difficult to be IMPLEMENTED and more verbose.



Discussion

No Comment Found

Related InterviewSolutions