I want to get all *.txt
files in the directory ../20180101_Folder
.
My code:
theFiles <- list.files(
path = "../*Folder",
pattern = "*.txt",
full.names = TRUE
)
But theFiles
ends up being NULL
. How do I make theFiles
equal to a list of all .txt
files in the specified directory?
list.files will expand ~ in a path, but will not expand wild-cards like *. To use those you need
path=Sys.glob("../*Folder")
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments