Skip to content

Commit

Permalink
fix: pattern to get obs files for intercrop usms or not (get_file_) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
plecharpent authored Sep 9, 2024
1 parent 4df2cee commit 5575648
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/get_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ get_file_ <- function(workspace,
if (length(workspace_files) && !is.null(usm_name)) {
idx <- lapply(str2regex(usm_name),
function(y) {
patt <- paste0(y, "\\.", file_ext)
# using optional "p" or "a" in pattern for associated crops
# p for principal crop, a for associated crop
patt <- paste0(y, "[a|p]?\\.", file_ext)
grep(pattern = patt, x = workspace_files)
}
)
Expand Down

0 comments on commit 5575648

Please sign in to comment.