+2 votes
in R Language by
Differentiate between lapply and sapply.

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.

Related questions

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