Skip to content

Commit

Permalink
Switch if/else order
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Jun 23, 2024
1 parent d418df2 commit 2efb0f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/get_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ lr_get_spec <- function(where = getwd(), ext = "txt", lim = c(300, 700),

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

if (!interpolate) {
gsp <- function(f) {
dispatch_parser(f, decimal = decimal, sep = sep)[[1]]
}
} else {
if (interpolate) {
gsp <- function(f) {
df <- dispatch_parser(f, decimal = decimal, sep = sep)[[1]]

Expand All @@ -98,6 +94,11 @@ lr_get_spec <- function(where = getwd(), ext = "txt", lim = c(300, 700),
call. = FALSE)
return(NULL)
}
} else {
gsp <- function(f) {
dispatch_parser(f, decimal = decimal, sep = sep)[[1]]
}
}

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

Expand Down

0 comments on commit 2efb0f3

Please sign in to comment.