-2

I would like to download the following zip folder which contains 2 files and open it to manipulate the data. Presently I only know how to download it manually.

https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip

I would also like to download the following zip folder which contains a series of nested folders containing data that I am interested in downloading to manipulate. Presently I am only downloading them manually:

https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip

Can anyone advise me how to do it through coding in R?

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
  • Welcome to StackOverflow. A quick tip: It's good practice to provide a [minimal reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Otherwise your question might get closed because it looks like "here's my prob, do the work for me" (amongst other things). – lukeA Aug 24 '14 at 09:55

1 Answers1

1

Here's a way to do it:

fn <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
download.file(fn, tf <- tempfile(fileext = ".zip"))
unzip(tf, exdir = td <- file.path(tempdir(), "myzip"))
(list.files(td, full.names = TRUE, recursive = TRUE))
lukeA
  • 53,097
  • 5
  • 97
  • 100