The problem is that mapply
is trying to apply the given function to each of the elements of all of the specified arguments in sequence. Since you only want to do this for one argument, you should use lapply
, not mapply
:
lapply(data, quantile, probs=tert, name=FALSE)
Alternatively, you can still use mapply
but specify the arguments that are not to be looped over in the MoreArgs
argument.
mapply(quantile, data, MoreArgs=list(probs=tert, name=FALSE))