Reading from file in R when I have a part of its name -
Reading from file in R when I have a part of its name -
how can read file in r when have part of name including starting or ending characters?
thanks
you can utilize list.files
, has pattern
argument, seek match close can.
writelines(c('hello', 'world'), '~/tmp/example_file_abc') filename <- list.files(path = '~/tmp', pattern = 'file_abc$', full.names = true)[1] readlines(filename) # [1] "hello" "world"
r
Comments
Post a Comment