szcf-weiya / techNotes

My notes about tech (Linux/R/Julia/Python/Cpp/etc.)
https://tech.hohoweiya.xyz/
11 stars 7 forks source link

substitute a function name in an array of functions #15

Open szcf-weiya opened 3 years ago

szcf-weiya commented 3 years ago
> funs = c(mean, var, sd)
> substitute(funs[1])
funs[1] # target "mean"

possible helpful reference: https://stackoverflow.com/questions/1567718/getting-a-function-name-as-a-string