forked from rdpeng/ExData_Plotting1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExpAnalysisDownload.R
26 lines (21 loc) · 927 Bytes
/
ExpAnalysisDownload.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Exploratory Analysis Course Project 1
## Filename: ExpAnalysisDownload.R
## Author: [email protected]
## Date: May 2015
## Comment: Script to download and uncompress file with
## "Individual household electric power consumption Data Set"
## Set Working Directory
setwd("~/Coursera/Exploratory Data Analysis/Week1 - PA1")
getwd()
## Set File URL to download, Local Dataset ZIP Filename and Destination Filename
URLFilename <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip"
DestFilename <- "household_power_consumption.zip"
SrcFilename <- "household_power_consumption.txt"
## Download Dataset Zip File in Working Directory if file does not exist
if (file.exists(DestFilename) == FALSE) {
download.file(URLFilename, DestFilename, method = "curl")
}
## Unzip Dataset ZIP File if Data Directory does not exist
if (file.exists(SrcFilename) == FALSE) {
unzip(DestFilename)
}