rustr_init: Create a skeleton for a new source package with Rust support

Description Usage Arguments Details References See Also Examples

View source: R/init.R

Description

Create a skeleton for a new source package with Rust support.

Usage

1
2
3
4
rustr_init(name, path = ".", force = FALSE, code_files = character(),
  rust_files = character(), author = "Your Name", maintainer = if
  (missing(author)) "Your Name" else author, email = "your@email.com",
  license = "MIT")

Arguments

name

A character string: the package name and directory name for your package.

path

A path to put the package directory in.

force

See package.skeleton

code_files

See package.skeleton

rust_files

A character vector with the paths to Rust source files to add to the package.

author

Author of the package.

maintainer

Maintainer of the package.

email

Email of the package maintainer.

license

License of the package.

Details

There is a folder name rustlib in the created package src path. This folder is a rust library which will be compiled and linked by R. Just write Rust code in ./src/rustlib/src/ .

./src/rustlib/src/export.rs, ./src/REXPORT.c and ./R/REXPORT.R are generated by rustrize(), and they should not be edited by hand. Before building the package, run rustrize() to generate these three files.

References

Read the Writing R Extensions manual for more details.

See Also

https://book.rustr.org/create-a-rust-r-package.html

Examples

1
2
3
4
5
## Not run: 

rustr_init("test-pkg")

## End(Not run)

rustr/rustinr documentation built on June 2, 2020, 2:05 a.m.