Skip to content

Commit 0f6439d

Browse files
committed
Fix Efforts
1 parent a748221 commit 0f6439d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

R/DWF_Efforts_Process.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Efforts_Process <- function(
133133
IASDT.R::AssignEnvVars(EnvFile = EnvFile, EnvVarDT = EnvVars2Read)
134134
rm(EnvVars2Read, envir = environment())
135135

136+
AllRequests <- IASDT.R::Path(Path_Efforts, "Efforts_AllRequests.RData")
137+
136138
# # ..................................................................... ###
137139

138140
# Loading input data ------
@@ -163,17 +165,16 @@ Efforts_Process <- function(
163165
# Request efforts data ------
164166

165167
if (Request) {
166-
IASDT.R::CatTime("Requesting efforts data")
167168

169+
IASDT.R::CatTime("Requesting efforts data")
170+
168171
IASDT.R::Efforts_Request(
169172
EnvFile = EnvFile, NCores = NCores, StartYear = StartYear,
170173
Renviron = Renviron, Boundaries = Boundaries)
171174

172175
} else {
173-
Efforts_AllRequests <- IASDT.R::LoadAs(
174-
IASDT.R::Path(Path_Efforts, "Efforts_AllRequests.RData"))
175176

176-
if (!file.exists(Efforts_AllRequests)) {
177+
if (!file.exists(AllRequests)) {
177178
stop(
178179
"Efforts data was not requested and the file does not exist.",
179180
call. = FALSE)
@@ -195,15 +196,14 @@ Efforts_Process <- function(
195196

196197
} else {
197198

198-
Path_Efforts_Request <- IASDT.R::Path(
199-
Path_Efforts, "Efforts_AllRequests.RData")
200-
if (!file.exists(Path_Efforts_Request)) {
199+
if (!file.exists(AllRequests)) {
201200
stop(
202201
"Efforts data was not downloaded and the file does not exist.",
203202
call. = FALSE)
204203
}
205204

206-
Efforts_AllRequests <- IASDT.R::LoadAs(Path_Efforts_Request)
205+
Efforts_AllRequests <- IASDT.R::LoadAs(AllRequests)
206+
207207
if (!("DownPath" %in% names(Efforts_AllRequests))) {
208208
stop(
209209
"Efforts data was not downloaded and the 'DownPath' column is missing.",

0 commit comments

Comments
 (0)