I've been studying r language, and I started to use lapply and sapply functions.
But I've seen programmers recommending to use vapply instead of sapply.
I've searched in the documentation about sapply, and found the difference between sapply and lapply:
https://www.rdocumentation.org/packages/memisc/versions/0.99.13.2/topics/Sapply
Sapply is equivalent to sapply, except that it preserves the dimension and dimension names of the argument X. It also preserves the dimension of results of the function FUN. It is intended for application to results e.g. of a call to by. Lapply is an analog to lapply insofar as it does not try to simplify the resulting list of results of FUN.
So I was wondering, what is the difference between sapply and vapply functions ? What function is better to use, and in what scenarios?