r语言rcpp 无法加载_嫌R计算太慢?试试Rcpp入门篇

写在前面啰嗦下

R,python这样的高级语言,虽然上手快,也比较好入门。但是当遇到编写循环迭代等算法的时候,程序运行效率往往很慢。如果可以向量化,用内建函数那就试试。实在不行建议用C++吧。如果你想把C++R程序连接起来。那就试试Rcpp吧。什么是Rcpp,直接上Description

packageDescription("Rcpp")$Description
## [1] "The 'Rcpp' package provides R functions as well as C++ classes which\n offer a seamless integration of R and C++. Many R data types and objects can be\n mapped back and forth to C++ equivalents which facilitates both writing of new\n code as well as easier integration of third-party libraries. Documentation\n about 'Rcpp' is provided by several vignettes included in this package, via the\n 'Rcpp Gallery' site at , the paper by Eddelbuettel and\n Francois (2011, <10.18637>), the book by Eddelbuettel (2013,\n <10.1007>) and the paper by Eddelbuettel and Balamuta (2018,\n <10.1080>); see 'citation(\"Rcpp\")' for details."10.1080>10.1007>10.18637>

编写例子

在这里我写了一个统计fastq文件的Q20, Q30, GC, average length, total base

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值