我有一个包含 8 个 tif 文件的 LANDSAT 图像的文件夹。
list.files("C:/Users/Documents/04.HUMEDALES/L5__002072-09MAY-2006", pattern = glob2rx("*.TIF"),full.names = TRUE)
如图所示:
[1] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B1.TIF"
[2] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B2.TIF"
[3] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B3.TIF"
[4] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B4.TIF"
[5] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B5.TIF"
[6] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B6.TIF"
[7] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_B7.TIF"
[8] "C:/Users/Documents/L5__002072-09MAY-2006/LT05_L1TP_002072_20060509_20161121_01_T1_BQA.TIF"
如何仅列出波段 1 到 5 和 7 的 tif 文件?我找不到合适的模式。这是我得到的最接近的(仅删除最后一个文件:BQA.tif)
list.files("C:/Users/Documents/04.HUMEDALES/L5__002072-09MAY-2006", pattern = glob2rx("*B?.TIF"), full.names = TRUE)