r programming list.files with for than one file format -
i don't think can done, still, not hurt ask:
for example can see .csv , .rda files in working dir 1 command. i.e. can these 2 commands combined
list.files(pattern=".rda") list.files(pattern=".csv")
is best way:
a = list.files(pattern=".rda") b = list.files(pattern=".csv") print(c(a,b))
from ?list.files
pattern
optional regular expression. file names match regular expression returned.
you may use regex.
list.files(pattern="\\.(rda|csv)")
use end of line anchor if necessary.
list.files(pattern="\\.(rda|csv)$")
Comments
Post a Comment