Skip to content

Commit

Permalink
allow .tiff to work #115
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Endicott committed Jan 7, 2025
1 parent 7006d64 commit 1bb35ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/ccvi_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ ccvi_app <- function(testmode_in, ...){
shinyDirChoose(input, "clim_var_dir", root = volumes)
observe({
purrr::map(filePathIds(), shinyFileChoose, root = volumes, input = input,
filetypes = c("shp", "tif", "asc", "nc", "grd", "bil"))
filetypes = c("shp", "tif", "tiff", "asc", "nc", "grd", "bil"))
})

# parse file paths
Expand Down
4 changes: 2 additions & 2 deletions R/get_clim_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ get_clim_vars <- function(root_pth, scenario_names = "scn1"){
# remove spaces from scenario_names
scenario_names <- stringr::str_replace_all(scenario_names, "\\s", "_")

pats <- c("MAT.*tif$", "CMD.*tif$", "MAP.*tif$", "ccei.*tif$|CCEI.*tif$",
"MWMT.*tif$|HTN.*tif$", "clim_poly.*shp")
pats <- c("MAT.*\\.tif", "CMD.*\\.tif", "MAP.*\\.tif", "ccei.*\\.tif|CCEI.*\\.tif",
"MWMT.*\\.tif|HTN.*\\.tif", "clim_poly.*\\.shp")
err <- c(T, T, F, F, F, T)

clim_vars <- purrr::map2(pats, err, ~check_clim(root_pth, .x, .y, scenario_names)) %>%
Expand Down
2 changes: 1 addition & 1 deletion R/prep_clim_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ prep_clim_data <- function(mat_norm, mat_fut, cmd_norm, cmd_fut, ccei = NULL,
stop("out_folder does not exist", call. = FALSE)
}

ext_accept <- c(".asc", ".tif", ".nc", ".grd", ".img")
ext_accept <- c(".asc", ".tif", ".tiff", ".nc", ".grd", ".img")

make_pat <- function(x, ext_accept){
paste0(x, ext_accept, "$", collapse = "|")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/package_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Next we will load in the climate data that we prepared in the first step using t
clim_dat <- get_clim_vars(file.path(data_pth, "clim_files/processed"),
scenario_names = c("RCP 4.5", "RCP 8.5"))
str(clim_dat, max.level = 1)
str(clim_dat, max.level = 1, give.attr = FALSE)
```


Expand Down

0 comments on commit 1bb35ea

Please sign in to comment.