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

前端 未结 8 1187
Happy的楠姐
Happy的楠姐 2020-11-22 14:12

@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

8条回答
  •  孤街浪徒
    2020-11-22 14:32

    I used CRAN package "downloader" found at http://cran.r-project.org/web/packages/downloader/index.html . Much easier.

    download(url, dest="dataset.zip", mode="wb") 
    unzip ("dataset.zip", exdir = "./")
    

提交回复
热议问题