read_zip: Download a zipped file from the web and return the temporary...

View source: R/read_zip.R

read_zipR Documentation

Download a zipped file from the web and return the temporary paths to each file

Description

This function downloads and locally stores a zipped file from a url and then returns a list of the paths to each file

Usage

read_zip(url)

Arguments

url

A url to a zipped file

Examples

## Not run: 
# Download and view fuel economy data for all U.S. vehicles
# from 1980 to present (https://www.fueleconomy.gov/feg/download.shtml):
url <- 'https://www.fueleconomy.gov/feg/epadata/vehicles.csv.zip'
filePaths = read_zip(url)
print(filePaths)

# View first data file:
data <- read.csv(filePaths[1], header = TRUE)
head(data)

## End(Not run)

jhelvy/jph documentation built on July 12, 2024, 6:10 p.m.