path <- tempfile()
dir.create(path)
src <- system.file("examples/package", package = "odin", mustWork = TRUE)
file.copy(src, path, recursive = TRUE)
pkg <- file.path(path, "package")
# The package is minimal:
dir(pkg)
# But contains odin files in inst/odin
dir(file.path(pkg, "inst/odin"))
# Compile the odin code in the package
odin::odin_package(pkg)
# Which creates the rest of the package structure
dir(pkg)
dir(file.path(pkg, "R"))
dir(file.path(pkg, "src"))
Run the code above in your browser using DataLab