Ответ 1
Это работает:
#' Name of function
#'
#' Description
#'
#' @param x The input data
#' @param method one of: \cr
#' "method1" - very long text here \cr
#' "method2" - very long text here \cr
#' "method3" - very long text here \cr
#' "method4" - very long text here \cr
#' "method5" - very long text here \cr
#' "method6" - very long text here \cr
#' "method7" - very long text here \cr
#' "method8" - very long text here \cr
#' "method9" - very long text here \cr
#' "method10" - very long text here \cr
myfun <- function (x, method){return(NULL)}
Вот реальный пример в репо, где я использую \cr
: https://github.com/trinker/SOdemoing/blob/master/R/FUN.R
Также комментарий @Gregor хорошо взят. Это будет выглядеть так:
#' @param method2 one of:
#' \itemize{
#' \item method1 - very long text here
#' \item method2 - very long text here
#' \item method3 - very long text here
#' \item method4 - very long text here
#' \item method5 - very long text here
#' \item method6 - very long text here
#' \item method7 - very long text here
#' \item method8 - very long text here
#' \item method9 - very long text here
#' \item method10 - very long text here
#' }
Здесь вы можете увидеть вывод для обоих:
Я создал репозиторий GitHub repo, SOdemoing, чтобы проверить такие вещи (более сложные вопросы и ответы, связанные с пакетом). См. FUN.R, где я тестирую оба подхода с помощью roxygen2
, а затем справочное руководство, где я установил это снова (снова функция FUN.R).