Guest User

Untitled

a guest
Nov 23rd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. library(readr)
  2. library(dplyr)
  3. a_string <- read_file("nielsen_2016")
  4. split_lines <- strsplit(a_string, "\r\n")[[1]]
  5. split_cols <- strsplit(split_lines, "--")
  6. dat_frame <- ldply(split_cols)
  7. names(dat_frame) <- c("dma", "counties")
  8. write.csv(dat_frame, file = "dma_counties_2016.csv", row.names = F)
Add Comment
Please, Sign In to add comment