-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.Rhistory
88 lines (88 loc) · 2.77 KB
/
.Rhistory
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
install.packages("languageserver")
install.packages("httpgd")
install.packages('tidyverse')
install.packages('data.table')
install.packages("sf")
install.packages("mapview")
install.packages('parallel')
parallel::detectCores()
library(devtools)
create('OneDrive - University of Glasgow/Data service/AccessUK')
setwd("/Users/rafa/Library/CloudStorage/OneDrive-UniversityofGlasgow/Data service/AccessUK")
document()
download_accessibility_data <- function() {
# Define URLs and paths
url <- "https://zenodo.org/record/8037156/files/accessibility_indicators_gb.zip?download=1"
zip_file <- "accessibility_indicators_gb.zip"
data_dir <- "data"
# Check if the data directory exists, if not, create it
if (!dir.exists(data_dir)) {
dir.create(data_dir)
}
# Download the file
download.file(url, destfile = file.path(data_dir, zip_file))
# Unzip the file
unzip(file.path(data_dir, zip_file), exdir = data_dir)
# Remove the ZIP file
file.remove(file.path(data_dir, zip_file))
# Return invisibly
invisible(NULL)
}
download_accessibility_data()
# Define URLs and paths
url <- "https://zenodo.org/record/8037156/files/accessibility_indicators_gb.zip?download=1"
zip_file <- "accessibility_indicators_gb.zip"
data_dir <- "data"
# Download the file
download.file(url, destfile = file.path(data_dir, zip_file))
download_accessibility_data <- function() {
# Define URLs and paths
url <- "https://zenodo.org/record/8037156/files/accessibility_indicators_gb.zip?download=1"
zip_file <- "accessibility_indicators_gb.zip"
data_dir <- "data"
# Check if the data directory exists, if not, create it
if (!dir.exists(data_dir)) {
dir.create(data_dir)
}
# Download the file
download.file(url, destfile = file.path(data_dir, zip_file), timeout = 20*60)
# Unzip the file
unzip(file.path(data_dir, zip_file), exdir = data_dir)
# Remove the ZIP file
file.remove(file.path(data_dir, zip_file))
# Return invisibly
invisible(NULL)
}
download_accessibility_data
download_accessibility_data()
download_accessibility_data
getOption('timeout')
install.packages('r5r')
r5r::download_r5
xfun::download_file
download_accessibility_data <- function() {
if (getOption("timeout") == 60L) {
opts = options(timeout = 3600)
on.exit(options(opts), add = TRUE)
}
# Define URLs and paths
url <- "https://zenodo.org/record/8037156/files/accessibility_indicators_gb.zip?download=1"
zip_file <- "accessibility_indicators_gb.zip"
data_dir <- "data"
# Check if the data directory exists, if not, create it
if (!dir.exists(data_dir)) {
dir.create(data_dir)
}
# Download the file
download.file(url, destfile = file.path(data_dir, zip_file), timeout = 20*60)
# Unzip the file
unzip(file.path(data_dir, zip_file), exdir = data_dir)
# Remove the ZIP file
file.remove(file.path(data_dir, zip_file))
# Return invisibly
invisible(NULL)
}
download_accessibility_data()
document()
build()
install()