我正在使用R库docstring来生成函数文档.
我有一个函数列表,因此我想在其上映射或应用文档字符串函数.我想不出这是怎么回事.
library(docstring)
test1 = function(x) {
#' my docstring
#'
#' with some description
x + 1
}
test2 = function(y) {
#' another docstring
#'
#' witn more descriptions
y + 10
}
docstring(test1); docstring(test2) # works
f = lsf.str()
lapply(f, docstring)
Error in docstring_to_roxygen(fun, fun_name = fun_name, default_title = default_title) :
This function doesn't have any detectable docstring