daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data_path = "data"
  2. files <- dir(data_path, pattern = "*.txt")
  3.  
  4. data <- data_frame(filename = files) %>% # create a data frame
  5.                                          # holding the file names
  6.   mutate(file_contents = map(filename,          # read files into
  7.            ~ readLines(file.path(data_path, .))) # a new data column
  8.         )  
  9. data
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top