Hi together,

I am struggling a bit with the roxygen function import. Do you know how to add the dplyr %>% functionality to a function without importing the hole dplyr package?

This is my current solution:

#' Return first 10 entries
#'
#' @param mtcars a \code{data.frame} object
#'
#' @import dplyr
#' @return a \code{data.frame} with first 10 entries
#' @export
#'
#' @examples
#' fancyFunction(mtcars)
fancyFunction <- function(mtcars){
  output <- mtcars %>% head(10)
  return(output)
}


This is how I would like to have it:

#' Return first 10 entries
#'
#' @param mtcars a \code{data.frame} object
#'
#' @importFrom dplyr %>%
#' @return a \code{data.frame} with first 10 entries
#' @export
#'
#' @examples
#' fancyFunction(mtcars)
fancyFunction <- function(mtcars){
  output <- mtcars %>% head(10)
  return(output)
}


Do you have any idea how to deal with this problem?

Best

Tobias

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to