diff --git a/packages/archive/install b/packages/archive/install new file mode 100644 index 0000000..a695170 --- /dev/null +++ b/packages/archive/install @@ -0,0 +1,8 @@ +#!/bin/bash + +set -x +set -e + +apt-get update -qq +apt-get install libarchive-dev + diff --git a/packages/archive/test.R b/packages/archive/test.R new file mode 100644 index 0000000..8eed4d7 --- /dev/null +++ b/packages/archive/test.R @@ -0,0 +1,26 @@ +options(download.file.method="curl") +install.packages("archive", repos = "https://cran.rstudio.com") +library(archive) + + +## https://archive.r-lib.org/reference/archive_write_files.html + +# write some files to a directory +d <- tempfile() +dir.create(d) +old <- setwd(d) + +write.csv(iris, file.path(d, "iris.csv")) +write.csv(mtcars, file.path(d, "mtcars.csv")) +write.csv(airquality, file.path(d, "airquality.csv")) + +# Add some to a new archive +a <- archive_write_files("data.tar.gz", c("iris.csv", "mtcars.csv")) +setwd(old) +a + +# Add all files in a directory +a <- archive_write_dir("data.zip", d) +a + +unlink("data.zip")