用于隔离以模式结尾的文件的通配符表达式

Wildcard expression to isolate files that end with pattern

我正在尝试隔离 R 中的所有 .tif 文件,但以下代码也是 returns .tif.enp 文件。如何进行?

 f <- list.files(getwd(), pattern=".*tif") 

@Gregor 和@rawr 的两种解决方案都运行良好。

f <- list.files(getwd(), pattern="\.tif$") 
f <- Sys.glob(file.path(getwd(), '*tif'))