Using R to download zipped data file, extract, and import data

Posted by Jeromy Anglim on Stack Overflow See other posts from Stack Overflow or by Jeromy Anglim
Published on 2010-06-16T13:52:05Z Indexed on 2010/06/16 15:32 UTC
Read the original article Hit count: 266

Filed under:
|
|

@EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats"

I was also trying to do this today, but ended up just downloading the zip file manually.

I tried something like:

fileName <- "http://www.newcl.org/data/zipfiles/a1.zip"
con1 <- unz(fileName, filename="a1.dat", open = "r")

but I feel as if I'm a long way off. Any thoughts?

© Stack Overflow or respective owner

Related posts about r

    Related posts about zip