Skip to content

Commit 6193de5

Browse files
authored
Fix typos in the vignettes (#1344)
* Fix typos. * Add ChangeLog entry. * Standardise format of the last ChangeLog entry.
1 parent dbea570 commit 6193de5

10 files changed

+53
-41
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2024-11-03 Marco Colombo <[email protected]>
2+
3+
* vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typos
4+
* vignettes/rmd/Rcpp-attributes.Rmd: Idem
5+
* vignettes/rmd/Rcpp-extending.Rmd: Idem
6+
* vignettes/rmd/Rcpp-introduction.Rmd: Idem
7+
* vignettes/rmd/Rcpp-libraries.Rmd: Idem
8+
* vignettes/rmd/Rcpp-modules.Rmd: Idem
9+
* vignettes/rmd/Rcpp-package.Rmd: Idem
10+
* vignettes/rmd/Rcpp-quickref.Rmd: Idem
11+
* vignettes/rmd/Rcpp-sugar.Rmd: Idem
12+
113
2024-11-02 Dirk Eddelbuettel <[email protected]>
214

315
* tests/tinytest.R: Minor code edit, removal of two no longer

vignettes/rmd/Rcpp-FAQ.Rmd

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fontsize: 9pt
4242
# Optional: Force one-column layout, default is two-column
4343
#one_column: true
4444

45-
# Optional: Enables lineo mode, but only if one_column mode is also true
45+
# Optional: Enables lineno mode, but only if one_column mode is also true
4646
#lineno: true
4747

4848
# Optional: Enable one-sided layout, default is two-sided
@@ -111,7 +111,7 @@ vignette("Rcpp-attributes")
111111
```
112112

113113
If you do not have \pkg{Rcpp} installed, these documents should also be available
114-
whereever you found this document, \textsl{i.e.,} on every mirror site of CRAN.
114+
wherever you found this document, \textsl{i.e.,} on every mirror site of CRAN.
115115

116116
## What do I need
117117

@@ -157,7 +157,7 @@ Specific per-platform notes:
157157
Fortran-using packages are to be built); also see \faq{q:OSX} and
158158
\faq{q:OSXArma} below. This is frustratingly moving target; consult
159159
the \code{r-sig-mac} list (and its archives) for (current) details.
160-
\item[Linux] user need to install the standard developement packages. Some
160+
\item[Linux] user need to install the standard development packages. Some
161161
distributions provide helper packages which pull in all the required
162162
packages; the \texttt{r-base-dev} package on Debian and Ubuntu is an example.
163163
\end{description}
@@ -181,7 +181,7 @@ exhaustive as CRAN by now has \textsl{many} helpful packages:
181181
Attributes (see \faq{using-attributes} and
182182
\faq{prototype-using-attributes}) feature provided by \pkg{Rcpp};
183183
\item[\pkg{RUnit}, \pkg{tinytest}, \pkg{testthat}] can be used for unit
184-
testing; \pkg{Rcpp} uses \pkg{tinytest} as it is ligthweight and installs the
184+
testing; \pkg{Rcpp} uses \pkg{tinytest} as it is lightweight and installs the
185185
tests along with the package by default but note that no testing package is
186186
\textsl{required}: all are optional;
187187
\item[\pkg{rbenchmark}, \pkg{microbenchmark}] to run simple timing
@@ -301,12 +301,12 @@ the supplied code and makes it available under the selected identifier.
301301
Similarly, \rdoc{Rcpp}{sourceCpp} can read in a file and compile, link and load
302302
the code therein.
303303

304-
## How do I convert my prototyped code to a package {#from-inline-to-package}
304+
## How do I convert my prototype code to a package {#from-inline-to-package}
305305

306306
Since release 0.3.5 of \pkg{inline}, one can combine \faq{using-inline} and
307307
\faq{make-package}. See `help("package.skeleton-methods")` once
308308
\pkg{inline} is loaded and use the skeleton-generating functionality to
309-
transform a prototyped function into the minimal structure of a package.
309+
transform a prototype function into the minimal structure of a package.
310310
After that you can proceed with working on the package in the spirit of
311311
\faq{make-package}.
312312

@@ -384,7 +384,7 @@ for you.
384384
Note that we always need to set `PKG_CXXFLAGS` (or equally `PKG_CPPFLAGS`) to tell R
385385
where the \pkg{Rcpp} headers files are located.
386386

387-
Once `R CMD SHLIB` has created the dyanmically-loadable file (with
387+
Once `R CMD SHLIB` has created the dynamically-loadable file (with
388388
extension `.so` on Linux, `.dylib` on macOS or `.dll` on
389389
Windows), it can be loaded in an R session via \rdoc{base}{dyn.load}, and the
390390
function can be executed via \rdoc{base}{.Call}. Needless to say, we
@@ -551,7 +551,7 @@ By now REvolution R is defunct too.
551551

552552
Rho, previously known as CXXR, is an ambitious project that aims to
553553
totally refactor the \proglang{R} interpreter in \proglang{C++}. There
554-
are a few similaritites with \pkg{Rcpp} but the projects are
554+
are a few similarities with \pkg{Rcpp} but the projects are
555555
unrelated.
556556

557557
Rho / CXXR and \pkg{Rcpp} both want \proglang{R} to make more use of \proglang{C++}
@@ -1110,7 +1110,7 @@ at some limit. We chose 20.
11101110

11111111
A good discussion is available at
11121112
[this StackOverflow question](http://stackoverflow.com/questions/27371543)
1113-
concering data.frame creation with \pkg{Rcpp}. One solution offers a custom
1113+
concerning data.frame creation with \pkg{Rcpp}. One solution offers a custom
11141114
`ListBuilder` class to circumvent the limit; another suggests to simply
11151115
nest lists.
11161116

@@ -1171,7 +1171,7 @@ But of course. In a nutshell, this boils down to \emph{what your compiler
11711171
[Rcpp Gallery article](http://gallery.rcpp.org/articles/rcpp-and-c++11-c++14-c++17/) providing more detail. What follows in an abridged summary.
11721172
11731173
You can always \emph{locally} set appropriate `PKG_CXXFLAGS` as an
1174-
environment variable, or via `~/.R/Makevars`. You can also plugins and/or R
1174+
environment variable, or via `~/.R/Makevars`. You can also set plugins and/or R
11751175
support from `src/Makevars`:
11761176
11771177
- _C++11_: has been supported since early 2013 via a plugin selecting
@@ -1239,7 +1239,7 @@ and all three formats are also available a zip-archives:
12391239

12401240
## Does it really work
12411241

1242-
We take quality seriously and have developped an extensive unit test suite to
1242+
We take quality seriously and have developed an extensive unit test suite to
12431243
cover many possible uses of the \pkg{Rcpp} API.
12441244

12451245
We are always on the look for more coverage in our testing. Please let us know
@@ -1452,7 +1452,7 @@ circumvented as it is really a pointer to the underlying R object.
14521452
## Issues with implicit conversion from an \pkg{Rcpp} object to a scalar or other \pkg{Rcpp} object
14531453

14541454
Not all \pkg{Rcpp} expressions are directly compatible with
1455-
`operator=`. Compability issues stem from many \pkg{Rcpp} objects and
1455+
`operator=`. Compatibility issues stem from many \pkg{Rcpp} objects and
14561456
functions returning an intermediary result which requires an explicit
14571457
conversion. In such cases, the user may need to assist the compiler
14581458
with the conversion.
@@ -1587,7 +1587,7 @@ There are three options to trigger compilation with \proglang{C++11}.
15871587
The first -- and most likely option to use -- will be the plugin support offered
15881588
by \pkg{Rcpp} attributes. This can be engaged by adding
15891589
`// [[Rcpp::plugins(cpp11)]]` to the top of the \proglang{C++} script.
1590-
For diagnostic and illustrativative purposes, consider the following code
1590+
For diagnostic and illustrative purposes, consider the following code
15911591
which checks to see if `R_xlen_t` is available on your platform:
15921592

15931593
```{Rcpp}
@@ -1732,7 +1732,7 @@ figure out what routines need to be registered. If an older `RcppExports.R` file
17321732
is discovered, its out-of-date symbol names get picked up, and registration
17331733
rules for those symbols get written as well. This will register more symbols for
17341734
the package than are actually defined, leading to an error. This point has been
1735-
discussed at some length both in the GitHub issue tickes, on StackOverflow and
1735+
discussed at some length both in the GitHub issue tickets, on StackOverflow and
17361736
elsewhere.
17371737

17381738
So if your autogenerated file fails, and a `symbols not found` error is reported

vignettes/rmd/Rcpp-attributes.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fontsize: 9pt
4949
# Optional: Force one-column layout, default is two-column
5050
#one_column: true
5151

52-
# Optional: Enables lineo mode, but only if one_column mode is also true
52+
# Optional: Enables lineno mode, but only if one_column mode is also true
5353
#lineno: true
5454

5555
# Optional: Enable one-sided layout, default is two-sided

vignettes/rmd/Rcpp-extending.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fontsize: 9pt
4646
# Optional: Force one-column layout, default is two-column
4747
#one_column: true
4848

49-
# Optional: Enables lineo mode, but only if one_column mode is also true
49+
# Optional: Enables lineno mode, but only if one_column mode is also true
5050
#lineno: true
5151

5252
# Optional: Enable one-sided layout, default is two-sided

vignettes/rmd/Rcpp-introduction.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ output:
5959
pinp::pinp:
6060
collapse: true
6161

62-
# Local additiona of a few definitions we use
62+
# Local additions of a few definitions we use
6363
header-includes: >
6464
\newcommand{\TODO}{\marginnote{TODO}}
6565
\newcommand{\rlang}{\textit{R }}
@@ -144,7 +144,7 @@ statement is now added: _Interfaces to other software are part of \rlangns_.
144144

145145
This last addition is profound. If and when suitable and performant
146146
software for a task exists, it is in fact desirable to have a (preferably
147-
also perfomant) interface to this software from \rlangns.
147+
also performant) interface to this software from \rlangns.
148148
\cite{Chambers:2016:ExtR} discusses several possible approaches for simpler
149149
interfaces and illustrates them with reference implementations to both \python\ and
150150
\julia. However, the most performant interface for \rlang is provided at the
@@ -155,7 +155,7 @@ analysts and data scientists, aiming to enable them to use---and
155155
create--- further _interfaces_ for \rlang which aid the _mission_ while
156156
staying true to the _prime directive_. Adding interfaces in such a way is in
157157
fact a natural progression from the earliest designs for its predecessor
158-
\slang which was after all designed to provide a more useable 'interface' to
158+
\slang which was after all designed to provide a more usable 'interface' to
159159
underlying routines in \fortranns.
160160

161161
The rest of the paper is structured as follows. We start by discussing
@@ -188,7 +188,7 @@ elements can be obtained in different ways. Some of these are addressed in the _
188188
the Rtools kit provided by R Core available at <https://cran.r-project.org/bin/windows/Rtools/>.
189189
Details of these installation steps are beyond the scope of this
190190
paper. However, many external resources exist that provide detailed
191-
installation guides for \rlang toolschains in
191+
installation guides for \rlang toolchains in
192192
[Windows](http://thecoatlessprofessor.com/programming/rcpp/install-rtools-for-rcpp/)
193193
and
194194
[macOS](http://thecoatlessprofessor.com/programming/r-compiler-tools-for-rcpp-on-os-x/).
@@ -354,7 +354,7 @@ convolve_cpp(const NumericVector& a,
354354

355355
To deploy such code from within an \rlang script or session, first save it into a new
356356
file---which could be called **convolve.cpp**---in either the working directory, a
357-
temporary directoy or a project directory. Then from within the \rlang session,
357+
temporary directory or a project directory. Then from within the \rlang session,
358358
use `Rcpp::sourceCpp("convolve.cpp")` (possibly using a path as well as the filename). This
359359
not only compiles, links and loads the code within the external file but also adds the
360360
necessary "glue" to make the \rcpp function available in the \rlang environment. Once the
@@ -481,7 +481,7 @@ evalCpp("R::rnorm(0, 1)")
481481

482482
One important aspect of the behind-the-scenes code generation for the single expression
483483
(as well as all code created via _Rcpp Attributes_) is the automatic preservation of the
484-
state of the random nunber generators in \rlangns. This means that from a given seed, we will
484+
state of the random number generators in \rlangns. This means that from a given seed, we will
485485
receive _identical_ draws of random numbers whether we access them from \rlang or via \cpp code
486486
accessing the same generators (via the \rcpp interfaces). To illustrate, the
487487
same number is drawn via \rlang code after resetting the seed:

vignettes/rmd/Rcpp-libraries.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ doi_footer: "https://arxiv.org/abs/1911.06416"
1818

1919
# Abstract
2020
abstract: |
21-
We desribe how we extend R with an external C++ code library by using the Rcpp
21+
We describe how we extend R with an external C++ code library by using the Rcpp
2222
package. Our working example uses the recent machine learning library and application
2323
'Corels' providing optimal yet easily interpretable rule lists \citep{arxiv:corels}
2424
which we bring to R in the form of the \pkg{RcppCorels} package
@@ -141,7 +141,7 @@ The first step in getting a new package combing R and C++ is often the creation
141141
Rcpp package. There are several helper functions to choose from. A natural first choice
142142
is `Rcpp.package.skeleton()` from the \pkg{Rcpp} package \citep{CRAN:Rcpp}. It can be
143143
improved by having the optional helper package \pkg{pkgKitten} \citep{CRAN:pkgKitten}
144-
around as its `kitten()` function smoothes some rougher edges left by the underlying Base
144+
around as its `kitten()` function smooths some rougher edges left by the underlying Base
145145
R function `package.skeleton()`. This step is shown below in then appendix, and
146146
corresponds to the first commit, followed by a first edit of file `DESCRIPTION`.
147147

@@ -154,7 +154,7 @@ it.
154154

155155
Given a basic package with C++ support, we can now turn to integrating the external
156156
package. This complexity of this step can, as alluded to earlier, vary from very easy to
157-
very complex. Simple cases include just dependending on library headers which can either
157+
very complex. Simple cases include just depending on library headers which can either
158158
be copied to the package, or be provided by another package such as \pkg{BH}
159159
\citep{CRAN:BH}. It may also be a dependency on a fairly standard library available on
160160
most if not all systems. The graphics formats bmp, jpeg or png may be example; text
@@ -243,7 +243,7 @@ fs::dir_tree("../../../rcppcorels/inst/sample_data")
243243
## Set up working example
244244

245245
Combining the two preceding steps, we can now offer an illustrative example. It is
246-
included in the helpd page for function `corels()` and can be run from R via
246+
included in the help page for function `corels()` and can be run from R via
247247
`example("corels")`.
248248

249249
```r
@@ -279,7 +279,7 @@ arguments default values are used.
279279

280280
## Finesse Library Dependencies
281281

282-
One common difficulty when bringing an extermal library to R via a package consists in dealing with
282+
One common difficulty when bringing an external library to R via a package consists in dealing with
283283
an external dependency. In the case of 'Corels', the GNU GMP library for multi-precision arithmetic
284284
is an optional extension which, if available, improves and accelerates internal processing.
285285

vignettes/rmd/Rcpp-modules.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fontsize: 9pt
4646
# Optional: Force one-column layout, default is two-column
4747
#one_column: true
4848

49-
# Optional: Enables lineo mode, but only if one_column mode is also true
49+
# Optional: Enables lineno mode, but only if one_column mode is also true
5050
#lineno: true
5151

5252
# Optional: Enable one-sided layout, default is two-sided
@@ -93,7 +93,7 @@ vignette: >
9393

9494
Exposing \proglang{C++} functionality to \proglang{R} is greatly facilitated
9595
by the \pkg{Rcpp} package and its underlying \proglang{C++} library
96-
\citep{CRAN:Rcpp,JSS:Rcpp}. \pkg{Rcpp} smoothes many of the rough edges in
96+
\citep{CRAN:Rcpp,JSS:Rcpp}. \pkg{Rcpp} smooths many of the rough edges in
9797
\proglang{R} and \proglang{C++} integration by replacing the traditional
9898
\proglang{R} Application Programming Interface (API) described in
9999
'\textsl{Writing R Extensions}' \citep{R:Extensions} with a consistent set of \proglang{C++}
@@ -955,7 +955,7 @@ setMethod("show", yada$World , function(object) {
955955
object$greet())
956956
writeLines(msg)
957957
} )
958-
yada$World$new() # implictly calls show
958+
yada$World$new() # implicitly calls show
959959
```
960960

961961
TODO: mention R inheritance (John ?)

vignettes/rmd/Rcpp-package.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fontsize: 9pt
4848
# Optional: Force one-column layout, default is two-column
4949
#one_column: true
5050

51-
# Optional: Enables lineo mode, but only if one_column mode is also true
51+
# Optional: Enables lineno mode, but only if one_column mode is also true
5252
#lineno: true
5353

5454
# Optional: Enable one-sided layout, default is two-sided
@@ -161,7 +161,7 @@ $
161161
\end{ShadedResult}
162162

163163
Using \rdoc{Rcpp}{Rcpp.package.skeleton} is by far the simplest approach
164-
as it fulfills two roles. It creates the complete set of files needed for a
164+
as it fulfils two roles. It creates the complete set of files needed for a
165165
package, and it also includes the different components needed for using
166166
\pkg{Rcpp} that we discuss in the following sections.
167167

@@ -292,7 +292,7 @@ new standard, however, is much easier and is described below.
292292

293293
Unfortunately, the `LinkingTo` declaration in itself was not
294294
enough to link to the user \proglang{C++} library of \pkg{Rcpp}. Until more
295-
explicit support for libraries is added to \proglang{R}, ones needes to manually
295+
explicit support for libraries is added to \proglang{R}, ones needs to manually
296296
add the \pkg{Rcpp} library to the `PKG_LIBS` variable in the
297297
`Makevars` and `Makevars.win` files. (This has now changed with
298298
release 0.11.0; see below).
@@ -487,5 +487,5 @@ detail, and references to further examples were provided.
487487

488488
[^1]: Setting `attributes` to `TRUE` is the default. This document
489489
does not cover the behavior of `Rcpp.package.skeleton` when `attributes` is set
490-
to `FALSE` as we try to encourage package developpers to use
490+
to `FALSE` as we try to encourage package developers to use
491491
attributes.

vignettes/rmd/Rcpp-quickref.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fontsize: 9pt
4141
# Optional: Force one-column layout, default is two-column
4242
#one_column: true
4343

44-
# Optional: Enables lineo mode, but only if one_column mode is also true
44+
# Optional: Enables lineno mode, but only if one_column mode is also true
4545
#lineno: true
4646

4747
# Optional: Enable one-sided layout, default is two-sided
@@ -399,7 +399,7 @@ RNGScope scope;
399399
// In some cases (e.g. rnorm), dist-specific
400400
// arguments can be omitted; when in doubt,
401401
// specify all dist-specific arguments. The use
402-
// of doublesrather than integers for dist-
402+
// of doubles rather than integers for dist-
403403
// specific arguments is recommended. Unless
404404
// explicitly specified, log=FALSE.
405405

vignettes/rmd/Rcpp-sugar.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fontsize: 9pt
4848
# Optional: Force one-column layout, default is two-column
4949
#one_column: true
5050

51-
# Optional: Enables lineo mode, but only if one_column mode is also true
51+
# Optional: Enables lineno mode, but only if one_column mode is also true
5252
#lineno: true
5353

5454
# Optional: Enable one-sided layout, default is two-sided
@@ -123,7 +123,7 @@ RcppExport SEXP foo(SEXP x, SEXP y) {
123123
124124
The goal of the function `foo` code is simple. Given two
125125
`numeric` vectors, we create a third one. This is typical low-level
126-
\proglang{C++} code that that could be written much more consicely in
126+
\proglang{C++} code that that could be written much more concisely in
127127
\proglang{R} thanks to vectorisation as shown in the next example.
128128
129129
```{r, eval = FALSE}
@@ -501,7 +501,7 @@ One point to note is that the programmer using these functions needs to
501501
initialize the state of the random number generator as detailed in Section
502502
6.3 of the `Writing R Extensions' manual \citep{R:Extensions}. A nice
503503
\proglang{C++} solution for this is to use a \textsl{scoped} class that sets
504-
the random number generatator on entry to a block and resets it on exit. We
504+
the random number generator on entry to a block and resets it on exit. We
505505
offer the \code{RNGScope} class which allows code such as
506506

507507
```cpp
@@ -591,7 +591,7 @@ public:
591591
this)->size();
592592
}
593593
594-
/* definition ommited here */
594+
/* definition omitted here */
595595
class iterator;
596596
597597
inline iterator begin() const {
@@ -616,7 +616,7 @@ The `VectorBase` template has three parameters:
616616
generated by sugar expressions as these are guaranteed to produce
617617
expressions that are without missing values. An example is the
618618
`is_na` function. This parameter is used in several places as part
619-
of the compile time dispatch to limit the occurence of redundant
619+
of the compile time dispatch to limit the occurrence of redundant
620620
operations.
621621
- `VECTOR`: This parameter is the key of \sugar. This is the
622622
manifestation of CRTP. The indexing operator and the `size` method

0 commit comments

Comments
 (0)