Skip to content

Commit 8221093

Browse files
committed
update auxiliary file handling into subfolder
1 parent 99891a7 commit 8221093

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

source/data-handling-large-files-R.Rmd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,23 @@ library("R.utils")
3737
# download the CSV file example
3838
csv.url <- paste("https://s3-eu-west-1.amazonaws.com/lw-birdtracking-data/",
3939
csv.name, ".gz", sep = "")
40-
if(!file.exists(csv.name)){
41-
download.file(csv.url, destfile=paste(csv.name, ".gz", sep = ""))
42-
gunzip(paste(csv.name, ".gz", sep = ""))
40+
if(!file.exists(paste("./data-handling-large-files-R", csv.name, sep = "/"))){
41+
download.file(csv.url,
42+
destfile = paste(paste("./data-handling-large-files-R",
43+
csv.name, sep = "/"), ".gz", sep = ""))
44+
gunzip(paste(paste("./data-handling-large-files-R",
45+
csv.name, sep = "/"), ".gz", sep = ""))
4346
}
4447
4548
# download the sqlite database example
4649
db.url <- paste("https://s3-eu-west-1.amazonaws.com/lw-birdtracking-data/",
4750
db.name, ".gz", sep = "")
48-
if(!file.exists(db.name)){
49-
download.file(db.url, destfile=paste(db.name, ".gz", sep = ""))
50-
gunzip(paste(db.name, ".gz", sep = ""))
51+
if(!file.exists(paste("./data-handling-large-files-R", db.name, sep = "/"))){
52+
download.file(db.url, destfile = paste(paste("./data-handling-large-files-R",
53+
db.name, sep = "/"), ".gz",
54+
sep = ""))
55+
gunzip(paste(paste("./data-handling-large-files-R",
56+
db.name, sep = "/"), ".gz", sep = ""))
5157
}
5258
```
5359

0 commit comments

Comments
 (0)