file_read | R Documentation |
They are functionally equivalent to calling archive_read or
archive_write using format = "raw", archive = file
.
file_read(file, mode = "r", filter = NULL, options = character())
file_write(file, mode = "w", filter = NULL, options = character())
file |
|
mode |
|
filter |
|
options |
|
file_write()
returns an writable output connection,
file_read()
returns a readable input connection.
An 'archive_read' connection (for file_read()
) or an 'archive_write' connection (for file_write()
) to the file.
if (archive:::libarchive_version() > "3.2.0") {
# Write bzip2, base 64 encoded data and use high compression
write.csv(mtcars,
file_write("mtcars.bz2",
filter = c("uuencode", "bzip2"),
options = "compression-level=9"
)
)
# Read it back
read.csv(file_read("mtcars.bz2"), row.names = 1, nrows = 3)
unlink("mtcars.bz2")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.