a guest Mar 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- data_path = "data"
- files <- dir(data_path, pattern = "*.txt")
- data <- data_frame(filename = files) %>% # create a data frame
- # holding the file names
- mutate(file_contents = map(filename, # read files into
- ~ readLines(file.path(data_path, .))) # a new data column
RAW Paste Data