- Notifications
You must be signed in to change notification settings - Fork0
markvanderloo/linkstringdist
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Minimal example of anR package LinkingTo thestringdistC api.
You don't really need to install this package since you're not going touse it for anything. The code can be obtained by cloning this repository.
git clone https://github.com/markvanderloo/linkstringdist
This package uses a function from thestringdistC API, which is calledfrom pureC code. A more interesting andC++ based example can be found intherefinr package.
A full API description can be found by typing
?stringdist::stringdist_api
in theR console.
Don't forget to set@useDynLib via Roxygen documentation. Alternatively setuseDynLib() manually in theNAMESPACE file.
Addingstringdist to theImports fied of theDESCRIPTION file is notenough. You also need to add an@import stringdist Roxygen field or animport(stringdist) entry manually in theNAMESPACE file to ensure thatstringdist is loaded and the shared object files are available. Alternativelyan@ImportFrom or theNAMESPACE equivalent will work as well.
This package also registers its singleC routine for export. This is onlynecessary to avoid aNOTE when preparing a package for CRAN. I.E. the noteonly pops up when checking the package with the--as-cran flag. So it is notnecessary to add a file likeR_RegisterNativeRoutines.c for localpackages.
Code for this package was developed usingVIM.
About
Minimal example LinkingTo the stringdist C api
Resources
Uh oh!
There was an error while loading.Please reload this page.