compress_bundle | R Documentation |
Helper function wrapped around tar
for easy compression of bundles.
compress_bundle(
bundle_dir,
dir_to,
file_extension = ".tar",
tar,
extra_flags,
...
)
bundle_dir |
location of directory to compress; baton can be provided to automate the process. |
dir_to |
location to write the tar file; if baton provided this will default to the parent directory. |
file_extension |
character value; default set to |
tar |
parameter passed to |
extra_flags |
parameter passed to |
... |
additional parameters passed to |
In the context of {relay}, compress_bundle()
simplifies the process of compressing the bundle (see create_bundle
) into a single object
so it can be stored more efficiently or transferred across networks. When the baton object is provided, it will by default use the baton's unique-id within the bundle
and place the tar file within the parent directory. This behavior can be overridden by manually providing the file path to bundle_dir
parameter and the
write location parameter dir_to
. It is recommended to match the file_extension
to the type of compression; for example, if compression = 'gzip'
, the extension
should be '.tar.gz'
.
## Not run:
# Create a bundled baton
my_baton <- create_baton(bundled = TRUE,
bundle_params = list(dir = file.path('path', 'to', 'save', 'yaml'),
tree = c('subdir1', 'subdir2', 'subdir3')))
# Compress based upon baton
compress_bundle(my_baton, tar = 'tar', file_extension = '.tar.gz', compression = 'gzip')
# Compress based upon bundle directory
compress_bundle('path/to/location/to/tar', tar = 'tar', file_extension = '.tar.gz', compression = 'gzip')
# Uncompress: use normal method:
untar("path/to/nameoftarfile.tar.gz", exdir ="/unzip/location", tar = 'TAR')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.