Skip to contents

merge_split_zip() combines split ZIP files of Fude Polygon data provided by MAFF into a single ZIP archive.

Usage

merge_split_zip(path, output_dir = "", quiet = FALSE, overwrite = NULL)

Arguments

path

Path to the first part (.zip.001) of a split ZIP archive.

output_dir

Directory in which to save the merged ZIP file. Defaults to the same directory as path.

quiet

Logical. If TRUE, suppress progress messages.

overwrite

Whether to replace an existing ZIP file. If NULL (the default), ask for confirmation in an interactive session and raise an error in a non-interactive session. Set to TRUE to replace the file or FALSE to raise an error without prompting.

Value

Invisibly returns the path to the merged ZIP file, or NULL if the user declines or cancels the overwrite prompt.

Details

All parts of the split ZIP archive (e.g., .zip.001, .zip.002, and .zip.003) must be downloaded to the same directory before running this function.

The files are concatenated in numerical order to reconstruct the original ZIP archive. Its file listing is checked before it is saved. The resulting ZIP file is not extracted. The original split files are preserved.

Examples

if (FALSE) { # \dontrun{
merge_split_zip("MB0001_2026_2025_38.zip.001")
} # }