小编And*_*ris的帖子

R 包失败 devtools::check,因为即使在 NAMESPACE 中导入函数,“找不到函数”

尝试R使用roxygen2和构建我的第一个包devtools。我在该部分添加了一个使用%>%和的函数。当我运行它时失败,因为它找不到函数或.mutate@examplescheck()%>%mutate

基于thisthisthis我尝试了以下方法:

我有#' importFrom magrittr %>%#' importFrom dplyr mutate在函数的.R文件中。我也有magrittrdplyrImports:DESCRIPTION文件。运行后document(),我的NAMESPACE文件包含importFrom(dplyr,mutate)importFrom(magrittr,"%>%").

最小R/test.R文件:

#' Conditional mutate
#'
#' \code{mutate_cond} mutates the \code{data.frame} only on the rows that
#' satisfy the condition.
#' 
#' @param .data \code{data.frame}
#' @param condition expression …
Run Code Online (Sandbox Code Playgroud)

r devtools roxygen2 dplyr magrittr

7
推荐指数
1
解决办法
1194
查看次数

标签 统计

devtools ×1

dplyr ×1

magrittr ×1

r ×1

roxygen2 ×1