假设我运行该功能list.files()
我将得到一个如下所示的字符向量:
tst<-c("Test.Uncx4.1_2281.2_deBruijn.txt", "Test.Vax1_3499.1_deBruijn.txt",
"Test.Vax2_3500.1_deBruijn.txt", "Test.Vsx1_1728.1_deBruijn.txt",
"Train.Alx3_3418.2_deBruijn.txt", "Train.Alx4_1744.1_deBruijn.txt",
"Train.Arx_1738.2_deBruijn.txt", "Train.Bapx1_2343.1_deBruijn.txt",
"Train.Barhl1_2590.2_deBruijn.txt", "Train.Barhl2_3868.1_deBruijn.txt"
)
我遇到的问题是使用像这样的参数pattern
时list.files()
:list.files(dirs[1], pattern = "^[Train]",ignore.case=F)
我仍然希望得到所有文件,而我只希望得到火车文件。像这样:
c("Train.Alx3_3418.2_deBruijn.txt", "Train.Alx4_1744.1_deBruijn.txt",
"Train.Arx_1738.2_deBruijn.txt", "Train.Bapx1_2343.1_deBruijn.txt",
"Train.Barhl1_2590.2_deBruijn.txt", "Train.Barhl2_3868.1_deBruijn.txt")
这怎么可能或者我做错了什么?