if(!file.exists("./data/c3w4")){dir.create("./data/c3w4")}
url341 <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(url341, destfile = "./data/c3w4/pr341.zip")
I sure i used this set of command to download the file initially, but now that I am trying to reproduce code it is give the the error Error in download.file(url341, destfile = "./data/c3w4/") :
cannot open destfile './data/c3w4/', reason 'No such file or directory'
This is some relevant output from my console: I did delete the "pr341.zip" file i downloaded the first time.
> getwd()
[1] "C:/Users/avtarsingh/Downloads"
> list.dirs()
[1] "."
[2] "./data"
[3] "./data/c3w4"
[4] "./data/c3w4/UCI HAR Dataset"
[5] "./data/c3w4/UCI HAR Dataset/test"
[6] "./data/c3w4/UCI HAR Dataset/test/Inertial Signals"
[7] "./data/c3w4/UCI HAR Dataset/train"
[8] "./data/c3w4/UCI HAR Dataset/train/Inertial Signals"
[9] "./new"
> list.files("./data/c3w4")
[1] "project.Rmd" "UCI HAR Dataset"
*(added with edit) Just noticed that if I copy and paste the code from R markdown to the console, it works. Why?