- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Rstudio 用 Rcpp 构建一个包。一切正常,直到我将文档标记添加到我的函数文件中。我希望我忽略了一些明显的东西。
这是我的 R 函数文件:
#' @useDynLib tablr
#' @importFrom Rcpp sourceCpp
#'
#' fast.table
#'
#' C++ implementation of the R table function. Only supports numeric
#' vectors. Does not currently handle NAs.
#'
#' @param x1 Variable 1
#' @param x2 Variable 2
#' @return A table object equal in every way to an R table object with the same
#' inputs
#'
#' @export fast.table
fast.table <- function(x1, x2) {
nms <- c(deparse(substitute(x1)), deparse(substitute(x2)))
cpp_table(as.numeric(x1), as.numeric(x2), as.character(nms))
}
devtools::document()
这是命名空间文件的样子:
# Generated by roxygen2 (4.0.2): do not edit by hand
export(fast.table)
importFrom(Rcpp,"C++")
importFrom(Rcpp,Does)
importFrom(Rcpp,NAs.)
importFrom(Rcpp,Only)
importFrom(Rcpp,R)
importFrom(Rcpp,currently)
importFrom(Rcpp,fast.table)
importFrom(Rcpp,function.)
importFrom(Rcpp,handle)
importFrom(Rcpp,implementation)
importFrom(Rcpp,not)
importFrom(Rcpp,numeric)
importFrom(Rcpp,of)
importFrom(Rcpp,sourceCpp)
importFrom(Rcpp,supports)
importFrom(Rcpp,table)
importFrom(Rcpp,the)
importFrom(Rcpp,vectors.)
useDynLib(tablr)
@importFrom
标签正在解析函数标题文本并尝试从
Rcpp
导入每个“单词”包裹。
devtools::document()
:
Error: object 'C++' is not exported by 'namespace:Rcpp'
Execution halted
Exited with status 1.
> devtools::session_info()
Session info----------------------------------------------------------------------------------
setting value
version R version 3.1.1 (2014-07-10)
system x86_64, mingw32
ui RStudio (0.98.1049)
language (EN)
collate English_United States.1252
tz America/Chicago
Packages--------------------------------------------------------------------------------------
package * version date source
devtools 1.6.1 2014-10-07 CRAN (R 3.1.1)
Rcpp 0.11.3 2014-09-29 CRAN (R 3.1.1)
roxygen2 4.0.2 2014-09-02 CRAN (R 3.1.1)
rstudioapi 0.1 2014-03-27 CRAN (R 3.1.1)
stringr 0.6.2 2012-12-06 CRAN (R 3.1.0)
tablr * 0.1 <NA> local
最佳答案
通过在 @importFrom
之后放置 NULL 来解决标签:
#' @useDynLib tablr
#' @importFrom Rcpp sourceCpp
NULL
#' fast.table
#'
#' C++ implementation of the R table function. Only supports numeric
#' vectors. Does not currently handle NAs.
#'
#' @param x1 Variable 1
#' @param x2 Variable 2
#' @return A table object equal in every way to an R table object with the same
#' inputs
#'
#' @export fast.table
fast.table <- function(x1, x2) {
nms <- c(deparse(substitute(x1)), deparse(substitute(x2)))
cpp_table(as.numeric(x1), as.numeric(x2), as.character(nms))
}
关于Rstudio Roxygen2 @importFrom 解析函数头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26386811/
我正在使用 Rstudio 用 Rcpp 构建一个包。一切正常,直到我将文档标记添加到我的函数文件中。我希望我忽略了一些明显的东西。 这是我的 R 函数文件: #' @useDynLib tablr
尝试从使用共享约束的域类导入约束时,我得到以下异常。 绑定(bind)阶段出现异常 异常(exception): Property [somePackage.User.email] reference
我正在编写一个 R 包,我想使用另一个包中的一个函数( plotKML )。这个外部包有太多的依赖,我不希望我的用户被要求下载等。如果我使用 importFrom(plotKML, readGPX)在
我的 NAMESPACE文件是: # Generated by roxygen2 (4.0.1): do not edit by hand export(ARorderG) export(VOBoeg
当我在正在开发的 R 包上运行 check() 时,我收到错误 [无法找到函数 "str_trim"]。此后我添加了两件事: 1) In DESCRIPTION Imports: stringr 2)
本文整理了Java中org.jboss.shrinkwrap.api.importer.ZipImporter.importFrom()方法的一些代码示例,展示了ZipImporter.importF
本文整理了Java中org.jboss.shrinkwrap.impl.base.importer.zip.ZipImporterImpl.importFrom()方法的一些代码示例,展示了ZipIm
我是一名优秀的程序员,十分优秀!