Skip to content

Commit fbbb851

Browse files
committed
minor fixes
1 parent 2667ff7 commit fbbb851

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

_posts/2012-12-18-using-rmath-functions.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and returning its pnorm computed using the R `pnorm` function:
2222

2323

2424
{% highlight cpp %}
25-
#include <Rcpp.h>
25+
#include <Rcpp.h>
2626

2727
// [[Rcpp::export]]
2828
Rcpp::NumericVector mypnorm(Rcpp::NumericVector x) {
@@ -38,7 +38,7 @@ Rcpp::NumericVector mypnorm(Rcpp::NumericVector x) {
3838
{% endhighlight %}
3939

4040

41-
We can now use the function to compute the probaility distribution:
41+
We can now use the function to compute the probability distribution:
4242

4343
{% highlight r %}
4444
x <- seq(0, 1, length=1e3)
@@ -52,3 +52,7 @@ head(res)
5252
[1] 0.5000 0.5004 0.5008 0.5012 0.5016 0.5020
5353
</pre>
5454

55+
56+
Note that the C++ code, through its use via Rcpp attributes, will be augmented with
57+
an automatic instantiation of a `RNGScope` object which ensures a proper state
58+
of the R random number generator.

src/2012-12-18-using-rmath-functions.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* and returning its pnorm computed using the R `pnorm` function:
1919
*/
2020

21-
#include <Rcpp.h>
21+
#include <Rcpp.h>
2222

2323
// [[Rcpp::export]]
2424
Rcpp::NumericVector mypnorm(Rcpp::NumericVector x) {
@@ -33,7 +33,7 @@ Rcpp::NumericVector mypnorm(Rcpp::NumericVector x) {
3333
}
3434

3535
/**
36-
* We can now use the function to compute the probaility distribution:
36+
* We can now use the function to compute the probability distribution:
3737
*/
3838

3939
/*** R
@@ -44,3 +44,8 @@ head(res)
4444
4545
*/
4646

47+
/**
48+
* Note that the C++ code, through its use via Rcpp attributes, will be augmented with
49+
* an automatic instantiation of a `RNGScope` object which ensures a proper state
50+
* of the R random number generator.
51+
*/

0 commit comments

Comments
 (0)