R/rmd-utils.R

Defines functions pkgreview_print_source

Documented in pkgreview_print_source

#' Print review package function source code
#'
#' @param pkgname character string. review package name
#'
#' @return prints out function source code for all exported functions.
#' @export
#' @importFrom magrittr %>%
#' @examples
#' \dontrun{
#' library("pkgreviewr")
#' pkgreview_print_source("pkgreviewr")
#' }
pkgreview_print_source <- function(pkgname){

    ls(paste0("package:", pkgname)) %>%
        sapply(FUN = function(x){
            cat(paste0("## ",x, "\n"))
            get(x) %>% print
            cat(paste0("--- \n \n"))})
}
annakrystalli/pkgreviewr documentation built on Oct. 27, 2019, 4:22 a.m.