R packages are bundled in a tar.gz
, a tgz
or a zip
archive.
Information about a package is included in the archive and {pkg.peek} can help to extract it.
{pkg.peek} is only on GitHub and can be installed using the remotes package with the command:
remotes::install_github("robertdj/pkg.peek")
Archives come in two forms: Compiled or only with source code.
If the archive is created with e.g. devtools::build(binary = FALSE)
it only contains the source code and it is a tar.gz
file.
If the archive is created with e.g. devtools::build(binary = TRUE)
all code in the package is compiled and the file type depends on the operating system used to perform the compilation.
Such a compiled package is specific to the operating system -- a package compiled on Linux cannot be used on macOS.
A compiled package archive contains information about the operating system and R used to compile it. As an example, {pkg.peek} has a function to extract the version of R used for compilation:
pkg.peek::get_r_version("<path/to/package_archive>")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.