Skip to content

Commit f35e3d6

Browse files
committed
Switch if/else order
1 parent d418df2 commit f35e3d6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

R/get_spec.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ lr_get_spec <- function(where = getwd(), ext = "txt", lim = c(300, 700),
8080

8181
message(nb_files, " files found; importing spectra:")
8282

83-
if (!interpolate) {
84-
gsp <- function(f) {
85-
dispatch_parser(f, decimal = decimal, sep = sep)[[1]]
86-
}
87-
} else {
83+
if (interpolate) {
8884
gsp <- function(f) {
8985
df <- dispatch_parser(f, decimal = decimal, sep = sep)[[1]]
9086

@@ -98,6 +94,12 @@ lr_get_spec <- function(where = getwd(), ext = "txt", lim = c(300, 700),
9894
call. = FALSE)
9995
return(NULL)
10096
}
97+
}
98+
} else {
99+
gsp <- function(f) {
100+
dispatch_parser(f, decimal = decimal, sep = sep)[[1]]
101+
}
102+
}
101103

102104
df <- df[c(min(bounds) - 1, bounds, max(bounds) + 1), ]
103105

0 commit comments

Comments
 (0)