Automate zip file reading in R
I need to automate R to read a csv datafile that's into a zip file. For example, I would type: read.zip(file = "myfile.zip") And internally, what would be done is: Unzip myfile.zip to a temporary folder Read the only file contained on it using read.csv If there is more than one file into the zip file, an error is thrown. My problem is to get the name of the file contained into the zip file, in orded to provide it do the read.csv command. Does anyone know how to do it? UPDATE Here's the function I wrote based on @Paul answer: read.zip <- function(zipfile, row.names=NULL, dec=".") { # Create a