bb_cleanup | R Documentation |
A function for removing unwanted files after downloading. This function is not intended to be called directly, but rather is specified as a postprocess
option in bb_source
.
bb_cleanup(
pattern,
recursive = FALSE,
ignore_case = FALSE,
all_files = FALSE,
...
)
pattern |
string: regular expression, passed to |
recursive |
logical: should the cleanup recurse into subdirectories? |
ignore_case |
logical: should pattern matching be case-insensitive? |
all_files |
logical: should the cleanup include hidden files? |
... |
: extra parameters passed automatically by |
This function can be used to remove unwanted files after a data source has been synchronized. The pattern
specifies a regular expression that is passed to file.info
to find matching files, which are then deleted. Note that only files in the data source's own directory (i.e. its subdirectory of the local_file_root
specified in bb_config
) are subject to deletion. But, beware! Some data sources may share directories, which can lead to unexpected file deletion. Be as specific as you can with the pattern
parameter.
a list, with components status
(TRUE on success) and deleted_files
(character vector of paths of files that were deleted)
bb_source
, bb_config
, bb_decompress
## Not run:
## remove .asc files after synchronization
my_source <- bb_source(..., postprocess = list(list("bb_cleanup", pattern = "\\.asc$")))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.