For completeness, adding in what I chose to do here, which is to pick the method that has the most arguments and use prompt on that, then add in the other methods manually to the same help file.
The other alternative would have been to use Rd2roxygen to convert everything that was already in .Rd back to Roxygen and then use Roxygen for the whole project. This will likely be what I do in the next release.
You could roll-your-own by reading in a template help file (with readLines), then editing it to suit each particular case (judicious use of paste and gsub), then writing the result back out to file (via writeLines).
发布评论
评论(2)
为了完整起见,添加我在这里选择执行的操作,即选择具有最多参数的方法并使用提示,然后将其他方法手动添加到同一帮助文件中。
另一种选择是使用 Rd2roxygen 将 .Rd 中已有的所有内容转换回 Roxygen,然后在整个项目中使用 Roxygen。这可能是我在下一个版本中所做的事情。
For completeness, adding in what I chose to do here, which is to pick the method that has the most arguments and use prompt on that, then add in the other methods manually to the same help file.
The other alternative would have been to use Rd2roxygen to convert everything that was already in .Rd back to Roxygen and then use Roxygen for the whole project. This will likely be what I do in the next release.
您可以通过阅读模板帮助文件(使用
readLines
)来自行编写,然后对其进行编辑以适合每种特定情况(明智地使用paste
和gsub
),然后将结果写回文件(通过writeLines
)。You could roll-your-own by reading in a template help file (with
readLines
), then editing it to suit each particular case (judicious use ofpaste
andgsub
), then writing the result back out to file (viawriteLines
).