-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugv2.R
54 lines (37 loc) · 963 Bytes
/
debugv2.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
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
library(dplyr)
library(sf)
library(svDialogs)
# FCoord varie selon qu’on soit sur les observations ou de la préparation
# de données de prédiction
train <- FALSE # Si on veut entrainer le modèle, sinon predict
if (!train) {
date_pred <- as.character(dlgInput("Input date (YYYY-MM-dd): ")$res)
}
a <- Sys.time()
test1 <- list()
b <- Sys.time()
OccSL <- read.csv("data/SysGrid_500m_de_cote.csv") %>%
dplyr::select(c("X", "Y"))
c <- Sys.time()
test2 <- list()
d <- Sys.time()
OccSL$FID <- c(1:nrow(OccSL))
OccSL <- OccSL %>%
st_as_sf(coords = c("X", "Y"), crs = 4326, remove = FALSE)
e <- Sys.time()
test3 <- list()
f <- Sys.time()
OccSL_L93 <- OccSL %>%
st_transform(2154)
OccSL_L93$Nuit <- date_pred
g <- Sys.time()
test3 <- list()
h <- Sys.time()
print("Test 1 before loading csv")
print(b - a)
print("Test 2 after loading csv")
print(d - c)
print("Test 3 after sf")
print(f - e)
print("Test 2 after st_transform")
print(h - g)