Skip to content

Commit

Permalink
do not roxygenize chunk in vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
pachadotdev committed Jan 4, 2025
1 parent a781c99 commit f717713
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vignettes/cpp11.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,16 @@ This is easy to do in RMarkdown by using `{cpp11}` instead of `{r}` at the begin
It is possible to use `roxygen2` to document your C++ functions. Here is an
example of how to do this:

```{cpp11}
```{cpp11, eval = FALSE}
/* roxygen start
@title Mean of a numeric vector
@param x A numeric vector
@return The mean of the input vector
@examples mean_cpp(1:10)
@export
roxygen end */
[[cpp11::register]] double mean_roxygenised_cpp(doubles x) {
[[cpp11::register]]
double mean_roxygenised_cpp(doubles x) {
int n = x.size();
double total = 0;
for(double value : x) {
Expand Down

0 comments on commit f717713

Please sign in to comment.