archive_read | R Documentation |
Create a readable connection to a file in an archive.
archive_read(
archive,
file = 1L,
mode = "r",
format = NULL,
filter = NULL,
options = character()
)
archive |
|
file |
|
mode |
|
format |
|
filter |
|
options |
|
An 'archive_read' connection to the file within the archive to be read.
a <- system.file(package = "archive", "extdata", "data.zip")
# Show files in archive
a
# By default reads the first file in the archive.
read.csv(archive_read(a), nrows = 3)
# Can also specify a filename directly
read.csv(archive_read(a, "mtcars.csv"), nrows = 3)
# Or by position
read.csv(archive_read(a, 3), nrows = 3)
# Explicitly specify the format and filter if automatic detection fails.
read.csv(archive_read(a, format = "zip"), nrows = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.