【问题标题】:Using stri_count_fixed with overlap=TRUE returning an error of Incorrect number of arguments将 stri_count_fixed 与重叠 = TRUE 一起使用会返回参数数量不正确的错误
【发布时间】:2014-10-29 21:05:51
【问题描述】:

今天我看到一篇关于 stringi 包的新添加的新帖子,您可以在其中将参数 "overlap=TRUE" 添加到一些 stringi 搜索函数。

这是post

但是,我已经尝试了 bartektartanus 建议的确切代码(从安装到示例),当我运行它时,我得到一个错误 Incorrect number of arguments (3),expected 2 for 'stri_count_fixed'

> library("stringi", lib.loc="D:/Program Files/RRO/R-3.1.1/library")
> DNAlst<-list("CAAACTGATTTT","GATGAAAGTAAAATACCG","ATTATGC","TGGA","CGCGCATCAA")
> dna <- stri_paste(rep(c("A","C","G","T"),each=4),c("A","C","G","T"))
> result <- t(sapply(DNAlst, stri_count_fixed,pattern=dna,overlap=TRUE))
Error in .Call("stri_count_fixed", str, pattern, overlap, PACKAGE = "stringi") : 
  Incorrect number of arguments (3), expecting 2 for 'stri_count_fixed'
> colnames(result) <- dna
Error in colnames(result) <- dna : object 'result' not found

我想知道这是否是因为这是新事物,还是我做错了什么。

开发工具版本:1.6
Stringi 版本:0.3-1
R 版本 = 3.1.1(RRO 8.0 测试版)
在 Windows 8.1 上运行的 64 位

【问题讨论】:

    标签: regex r string dna-sequence stringi


    【解决方案1】:

    你可能安装错了。这种重叠有单独的分支。新的 stringi 版本 0.3 即将发布,尚未包含重叠 :) 但当我们正确测试时,它将与 0.4 版本一起发布。所以现在,从这个分支安装它:fixed_overlap

    library('devtools') # call install.packages('devtools') first
    install_github('Rexamine/stringi', ref = "fixed_overlap")
    

    【讨论】:

    • 不幸的是,我已经运行了这个确切的代码: install.packages('devtools');库(“开发工具”); install_github('Rexamine/stringi', ref = "fixed_overlap").就像你提到的那样。我什至尝试卸载 stringi 和 devtools,它一直在安装 stringi v.0.3,还有其他建议吗?
    【解决方案2】:

    问题发生是因为 R 试图找到 Rtools,但它找不到。系统快捷方式错误。你需要 Rtools 来正确执行devtools。 可悲的是,即使使用 Rtools 和 devtools 大声笑,当我在做一些完全不相关的事情时,我也发现了这一点......

    > library("devtools", lib.loc="D:/Program Files/RRO/R-3.1.1/library")
    WARNING: Rtools is required to build R packages, but the version of Rtools previously
    installed in F:/Program Files/Rtools has been deleted.
    

    cran link 重新安装 Rtools 后,程序按预期运行。

    然而,这个版本的stringi的安装用了将近半个小时才完成。

    【讨论】:

      猜你喜欢
      • 2015-01-07
      • 1970-01-01
      • 2018-09-05
      • 2023-02-04
      • 2021-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多