save_archive() saves archives in a formatted way, to help retrieve those archives for a use in a typical 'floodam.data' perspective.

save_archive(x, path, scope = NULL, extension = NULL, origin = "floodam.data")

Arguments

x

data.frame, data to be archived.

path

character, the path from wich the archive's path is constructed. See details.

scope

character or factor. If factor or long character, how x will be sliced. If character of length 1, may be the name of a variable of x. See details.

extension

character, the extension and so the format to be used for saving. See details.

origin

character, default value to "floodam.data". See details.

Value

Nothin useful.

Details

TO BE COMPLETED

Author

Frédéric Grelot

Examples


x = data.frame(scope = 0:2)
temp_dir = tempdir()
scope = "scope"

# No scope, no extension, only basename
save_archive(x, file.path(temp_dir, "x"))
#> Warning: Unmanaged extension. Nothing is saved.

# Adding a scope
save_archive(x, file.path(temp_dir, "x"), scope = "scope")
#> Warning: Some levels of scope ar NA. Corresponding data will not be saved.
#> Warning: Unmanaged extension. Nothing is saved.
#> Warning: Unmanaged extension. Nothing is saved.

# Using a path with extension, but also parameter extension
save_archive(x, file.path(temp_dir, "x.7z"), extension = "rds", scope = "scope")
#> Warning: Some levels of scope ar NA. Corresponding data will not be saved.