-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
406 lines (341 loc) · 14 KB
/
index.html
File metadata and controls
406 lines (341 loc) · 14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<!DOCTYPE HTML>
<!--
Story by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Rcpp</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<div id="wrapper" class="divided">
<!-- Banner -->
<section class="banner style5 content-align-left image-position-right fullscreen invert onload-image-fade-in onload-content-fade-in">
<div class="content">
<h2>Rcpp: Seamless R and C++ Integration</h2>
<!--<p class="major">Rcpp: Seamless R and C++ Integration</p>-->
<p>Extending and growing R applications via an easy-to-use, robust, and performant C++ interface.</p>
<p>All key R data types map naturally into key C++ data structures, and simple interfaces make transfer back and forth very easy. And by composing more complex interfaces become possible.</p>
<p>Numerous examples, as well as extensive documentation, facilitate its use.</p>
<ul class="actions stacked">
<li><a href="#first" class="button large wide smooth-scroll-middle">Get Started</a></li>
</ul>
</div>
<div class="image">
<!-- image source: https://pixabay.com/photos/rocket-launch-night-trajectory-693215/ -->
<img src="images/rocket-launch-g7825a95e4_1920.jpeg" alt="" />
</div>
</section>
<!-- Spotlight First Example -->
<section class="spotlight style1 orient-right content-align-left image-position-center onscroll-image-fade-in" id="first">
<div class="content">
<h3>First Steps are Easy!</h3>
<p>Rcpp makes it easy to create a first example. Just use <code>cppFunction("...")</code> and supply a valid C++ function in the argument string.</p>
<p>Here is a simple example from the introductory vignette:</p>
<pre><code>
library("Rcpp")
cppFunction("bool isOddCpp(int num = 10) {
bool result = (num % 2 == 1);
return result;
}")
isOddCpp(42L)
</code></pre>
<p>Of course, that function could be written in R (and we show an R variant in that vignette) but this provides a nice and simple stepping stone.</p>
</div>
<div class="image">
<!-- image source: https://pixabay.com/photos/starry-sky-milky-way-night-sky-2051448/ -->
<img src="images/starry-sky-gadc6145e7_1920.jpeg" alt="" />
</div>
</section>
<!-- Spotlight Second Example -->
<section class="spotlight style1 orient-left content-align-left image-position-center onscroll-image-fade-in" id="first">
<div class="content">
<h3>Recursive Functions Are Easy Too!</h3>
<p>Rcpp makes it equally easy to source code from a file via <code>sourcCpp("...")</code> and supply a path to a file as the argument.</p>
<p>The well-known Fibonacci sequence can set-up this way:</p>
<pre><code>
#include "Rcpp.h"
// [[Rcpp::export]]
int fibonacci(const int x) {
if (x < 2) return(x);
return (fibonacci(x - 1)) + fibonacci(x - 2);
}
/*** R
system.time(print(fibonacci(30)))
*/
</code></pre>
<p>This shows another nice trick: We can include an R example use in our C++ file by placing it behind a marker of <code>/*** R</code>. Try it! On
my computer, this call is still so fast that <code>system.time()</code> can barely measure it!.</p>
</div>
<div class="image">
<!-- image source: https://pixabay.com/photos/starry-sky-night-sky-stars-night-2675322/ -->
<img src="images/starry-sky-g3cc7b5997_1920.jpeg" alt="" />
</div>
</section>
<!-- Gallery for Packages -->
<section class="wrapper style2 align-center">
<div class="inner">
<h2>Rcpp Packages</h2>
<p>Rcpp is used by <a href="https://dirk.eddelbuettel.com/blog/2025/02/20#rcpp_3000_packages">over 3000 packages</a> on CRAN alone. Below is a small selection of some of the key packages.</p>
</div>
<!-- Gallery -->
<div class="gallery style2 large lightbox">
<article>
<a class="image"><img src="cards/cardRcpp.png" alt="Rcpp"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=Rcpp" class="button primary small">CRAN</a>
<a href="https://github.com/rcppcore/rcpp" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardRcppArmadillo.png" class="image"> <img src="cards/cardRcppArmadillo.png" alt="RcppArmadillo" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=RcppArmadillo" class="button primary small">CRAN</a>
<a href="https://github.com/rcppcore/rcpparmadillo" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardRcppEigen.png" class="image"> <img src="cards/cardRcppEigen.png" alt="RcppEigen" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=RcppEigen" class="button primary small">CRAN</a>
<a href="https://github.com/rcppcore/rcppeigen" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardRcppParallel.png" class="image"> <img src="cards/cardRcppParallel.png" alt="RcppParallel" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=RcppParallel" class="button primary small">CRAN</a>
<a href="https://github.com/rcppcore/rcppparallel" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardrstan.png" class="image"> <img src="cards/cardrstan.png" alt="rstan" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=rstan "class="button primary small">CRAN</a>
<a href="https://github.com/stan-dev/rstan" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardforecast.png" class="image"> <img src="cards/cardforecast.png" alt="forecast" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=forecast" class="button primary small">CRAN</a>
<a href="https://github.com/robjhyndman/forecast" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
<article>
<a href="cards/cardquanteda.png" class="image"> <img src="cards/cardquanteda.png" alt="" /> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="https://cran.r-project.org/package=quanted" class="button primary small">CRAN</a>
<a href="https://github.com/quanteda/quanteda" class="button primary small">GitHub</a>
</li>
</ul>
</div>
</article>
</div>
</section>
<!-- Spotlight Third Example -->
<section class="spotlight style1 orient-right content-align-left image-position-center onscroll-image-fade-in" id="first">
<div class="content">
<h3>The Gallery Has Numerous Examples!</h3>
<p>The related website <a href="https://gallery.rcpp.org">gallery.rcpp.org</a> contains over one hundred distinct examples, ranging from simple
first steps on how to create certain data types for features to more complex applications examples. All examples are fully tested and should be runnable.</p>
<p>Best of all, it is open website to which <emph>you</emph> could contribute the next article! See <a href="https://gallery.rcpp.org">gallery.rcpp.org</a> for more.</p>
</div>
<div class="image">
<!-- image source: https://pixabay.com/photos/milky-way-nebula-space-stars-sky-1845068/ -->
<img src="images/milky-way-gd8850624a_1920.jpeg" alt="" />
</div>
</section>
<!-- Gallery for Vignettes -->
<section class="wrapper style2 align-left">
<div class="inner">
<h2>Ten PDF Vignettes</h2>
<p>The Rcpp package comes with ten pdf vignettes documenting both first steps and more advanced use cases.</p>
<p>The <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">rcpp-devel</a> mailing can help with additional user- or
developer questions.</p>
</div>
<!-- Gallery -->
<div class="gallery style2 large lightbox">
<article>
<a class="image"><img src="vignettes/Rcpp-attributes.png" alt="Rcpp Attributes"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-attributes.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-extending.png" alt="Rcpp Extending"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-extending.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-FAQ.png" alt="Rcpp FAQ"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-FAQ.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-introduction.png" alt="Rcpp Introduction"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-introduction.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-libraries.png" alt="Rcpp Libraries"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-libraries.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-modules.png" alt="Rcpp Modules"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-modules.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-package.png" alt="Rcpp Package"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-package.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-quickref.png" alt="Rcpp Quick Reference"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-quickref.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-sugar.png" alt="Rcpp Sugar"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-sugar.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
<article>
<a class="image"><img src="vignettes/Rcpp-introduction-2011.png" alt="Rcpp Introduction (2011)"/> </a>
<div class="caption">
<ul class="actions fixed">
<li>
<a href="pdf/Rcpp-jss-2011.pdf" class="button primary small">PDF</a>
</li>
</ul>
</div>
</article>
</div>
</section>
<!-- Spotlight Book -->
<section class="spotlight style1 orient-right content-align-left image-position-center onscroll-image-fade-in" id="first">
<div class="content">
<h3>The Rcpp Book</h3>
<p>
The book, published in the Springer <em>useR!</em> series, is
<a href="http://www.springer.com/statistics/computational+statistics/book/978-1-4614-6867-7">available from the publisher</a> as both a soft-cover
version (ISBN 978-1-4614-6867-7) and an e-book (ISBN 978-1-4614-6868-4).
Institutions with a Springer Link subscription can also
access it. Springer provides <a href="http://link.springer.com/book/10.1007/978-1-4614-6868-4/page/1">electronic previews</a>.
</p>
<p>
The book is also available from
<a href="http://www.amazon.com/gp/product/1461468671/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1461468671&linkCode=as2&tag=rcpp-20&linkId=3P5LNUWOAQ2YMEJ6">Amazon</a>
and other on-line booksellers.
</div>
<div class="image">
<img src="images/seamless.png" alt="" />
</div>
</section>
<!-- Footer -->
<footer class="wrapper style1 align-center">
<div class="inner">
<ul class="icons">
<!-- <li><a href="https://github.com/rcppcore" class="icon brands style1 fa-github"><span class="label">GitHub RcppCore Org</span></a></li> -->
<li><a href="https://github.com/rcppcore/rcpp" class="icon brands style1 fa-github"><span class="label">GitHub Rcpp Repo</span></a></li>
<li><a href="https://stackoverflow.com/questions/tagged/rcpp" class="icon brands style1 fa-stack-overflow"><span class="label">StackOverflow</span></a></li>
<!-- <li><a href="#" class="icon brands style1 fa-facebook-f"><span class="label">Facebook</span></a></li> -->
<!-- <li><a href="#" class="icon brands style1 fa-instagram"><span class="label">Instagram</span></a></li> -->
<!-- <li><a href="https://www.linkedin.com/in/dirkeddelbuettel/" class="icon brands style1 fa-linkedin-in"><span class="label">LinkedIn</span></a></li> -->
<li><a href="mailto:rcpp-devel@lists.r-forge.r-project.org" class="icon style1 fa-envelope"><span class="label">Email</span></a></li>
</ul>
<p>
Website based on Story which is © Untitled and part of <a href="https://html5up.net">HTML5 UP</a>. Photos are courtesy of <a href="https://pixabay.com">pixabay</a>.
</p>
</div>
</footer>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<!-- Note: Only needed for demo purposes. Delete for production sites. -->
<!-- <script src="assets/js/demo.js"></script> -->
</body>
</html>