Getting a function name as a string

后端 未结 8 1299
半阙折子戏
半阙折子戏 2020-12-01 03:18

Say I have a bunch of functions, each with something likeMyFunction.1, etc. I want to pass these functions into another function, which prints out a small repo

8条回答
  •  不知归路
    2020-12-01 04:08

    I was wanting the same thing, and remembered library(foo) didn't need quotes, this is what it does:

    package <- as.character(substitute(package))
    

提交回复
热议问题