Skip to content

Commit f23b610

Browse files
author
Leo Bastos
committed
fixing order of warnings
1 parent 8dcbdf9 commit f23b610

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

R/nowcasting_inla.R

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,20 @@ nowcasting_inla <- function(dataset,
160160
data.by.week<-data.by.week
161161
message("Returning 'data.by.week'")
162162
}
163+
164+
if(missing(trajectories) | trajectories == FALSE){
165+
warning("Not returning trajectories")
166+
}else{
167+
trajectories = TRUE
168+
message("Trajectories returned")
169+
170+
if(!missing(age_col) & !missing(zero_inflated)){
171+
zero_inflated<-FALSE
172+
warning("'age_col' parsed, 'zero_inflated' ignored!")
173+
}
174+
}
175+
176+
163177
# ## Missing return.age warning
164178
# if(missing(return.age)){
165179
# return.age <- TRUE
@@ -169,27 +183,17 @@ nowcasting_inla <- function(dataset,
169183
if(missing(age_col)){
170184
warning("'age_col' missing, nowcasting with unstructured model")
171185
## Missing bins_age column warning
186+
}else{
187+
message("'age_col' inputed, nowcasting with structured model")
188+
172189
if(missing(bins_age)){
173190
bins_age <- "SI-PNI"
174191
warning("Using 'SI-PNI' age bins!")
175192
}else{
176193
bins_age<-bins_age
177194
message("Using age bins inputed")
178195
}
179-
}else{
180-
message("'age_col' inputed, nowcasting with structured model")
181-
}
182196

183-
if(missing(trajectories) | trajectories == FALSE){
184-
warning("Not returning trajectories")
185-
}else{
186-
trajectories = TRUE
187-
message("Trajectories returned")
188-
189-
if(!missing(age_col) & !missing(zero_inflated)){
190-
zero_inflated<-FALSE
191-
warning("'age_col' parsed, 'zero_inflated' ignored!")
192-
}
193197
}
194198
}
195199
# else{

0 commit comments

Comments
 (0)