C raft for your R package.
{craftthis}
is a workflow package: it automates repetitive tasks that
arise during development of R packages that use C code.
You can install the development version of {craftthis}
like so:
# install.packages("devtools")
devtools::install_github("ramiromagno/craftthis")
Create an R package named "mypkg"
that is ready for development with C
code.
# This will create a new RStudio session whose active project is your package
# mypkg
craftthis::craft_package('mypkg')
In the new session load the newly created package and run hello()
:
devtools::load_all()
hello()
craft_package()
automatically created a hello()
R function that
wraps a hello_()
C function using .Call()
.
craft_module()
: creates a C source and header files pair.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.