in R Language by
Q:
Differentiate between lapply and sapply.

▼ Show 1 Answer

0 votes
by

If the programmers want the output to be a data frame or a vector, then sapply function is used whereas if a programmer wants the output to be a list then lapply is used. There one more function known as vapply which is preferred over sapply as vapply allows the programmer to specific the output type. The disadvantage of using vapply is that it is difficult to be implemented and more verbose.

Learn More with Madanswer

Related questions

+2 votes
asked Jul 28, 2019 in R Language by Aarav2017
...