哪里是一个很好的教程创建一个R包与C ++源代码? [英] where is a good tutorial on creating an R package with C++ source code?

查看:161
本文介绍了哪里是一个很好的教程创建一个R包与C ++源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我开始查看配置脚本时,我感到很失望。我不知道如何去创建一个R包,它有几个功能从C / C ++构建的方式,以便它在Windows& Linux。我尝试修改现有包的内容是无效的。

I'm at a loss when I start looking at configure scripts. I'm not sure how to go about creating an R package which has several functions built from C/C++ in such a way that it's portable between Windows & Linux. My attempts to modify the guts of existing packages have been unfruitful.

任何帮助或链接都将非常感谢。

Any help or links would be greatly appreciated.

更新:如果可能我想链接:
Boost
CUDA ,&
hwloc

Update: If possible I would like to link against: Boost, CUDA, & hwloc

但是,我意识到Boost将是一场噩梦和噩梦。 hwloc不会好多了。所以我决定只是CUDA。这就是为什么我深入到底,并尝试修改一些现有的包以满足我的需要(rgl& rglpk)。但我愿意开始没有依赖和从根本上建立。谢谢大家的建议!!

However, I realize that Boost will be a nightmare & hwloc won't be much better. So I'd settle for just CUDA. This was why I dove in the deep end and tried modifying some existing packages to suit my needs (rgl & rglpk). But I'm willing to start out without dependencies and build from the ground up. Thank you everyone for your suggestions!!

推荐答案

当编写我的第一个包与编译代码时,我也失去了。这里有几个提示,但也许有更好的材料。

I was also quite lost when writing my first package with compiled code. Here are a few tips, but there is probably better material out there.

编写R包的主要内容是写R扩展。这是一个非常完整的指南,但这也使它很难阅读:
http://cran.r-project.org/doc/manuals/R-exts.pdf

The main piece about writing R packages is "Writing R extensions". This is a very complete guide, but that also makes it abit hard to read through: http://cran.r-project.org/doc/manuals/R-exts.pdf

这里是一个我在google上发现的小教程一次我先使用,包含如何使用C代码: http://www.stat.columbia.edu /~gelman/stuff_for_blog/AlanRPackageTutorial.pdf

Here is a small tutorial I found on google once which I used first, containing how to use C code: http://www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf

一般来说,关于R包的另一个指南,但不包含C代码:http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf

Another guide on R packages in general, but not with C code: http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf

Rcpp 是一个非常有用的C ++代码包,但我还没有使用它很多(事实上3天)。它在包本身有很多文档。

Rcpp is a very useful package for C++ code, but I haven't used it a lot yet (3 days in fact). It has a lot of documentation in the package itself.

这篇关于哪里是一个很好的教程创建一个R包与C ++源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆