The cause of the problem is that -qnorm(.) Is actually part of the two functions. First you compute qnorm(.) , Then you take negative .
sapply expects a single function.
When using sapply( <..>, -qnorm) R tries to calculate the minus qnorm function, which makes no sense to the functions.
(Just enter -qnorm and you will get the same error.)
The reason -qnorm(k) is because R calculates qnorm(k) to get a number, and then takes a negative value for that number.
Similarly, sapply(<..>, qnorm) gives a vector. Therefore, when you add a negative sign in front of it, you get the desired result.
source share