Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions R/process.R
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,8 @@ process_nlcd <-
"_.*\\.(tif|img)$"
),
full.names = TRUE,
recursive = TRUE, # ADD THIS - files may be in subdirectories
ignore.case = TRUE # ADD THIS - for robustness
recursive = TRUE,
ignore.case = TRUE
)

if (length(nlcd_file) == 0) {
Expand All @@ -882,11 +882,10 @@ process_nlcd <-
path,
pattern = paste0("nlcd_", year, "_.*\\.(tif|img)$"),
full.names = TRUE,
recursive = TRUE, # ADD THIS
ignore.case = TRUE # ADD THIS
recursive = TRUE,
ignore.case = TRUE
)
if (length(nlcd_file) > 0) {
# FIXED: was > 1, should be > 0
message(
paste0(
"Deprecated file paths detected. Data still imported, but ",
Expand Down Expand Up @@ -919,15 +918,14 @@ process_nlcd <-
paste(product_codes, collapse = "|"),
")_",
year,
"_.*\\.aux\\.xml$" # FIXED: escaped the dot before xml
"_.*\\.aux\\.xml$"
),
full.names = FALSE,
recursive = TRUE, # ADD THIS
ignore.case = TRUE # ADD THIS
recursive = TRUE,
ignore.case = TRUE
)

if (length(chr_aux_xml_path) > 0) {
# FIXED: handle multiple files
for (aux_file in chr_aux_xml_path) {
chr_aux_xml_hide <- file.path(
dirname(file.path(path, aux_file)),
Expand Down