Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(readr)
- library(dplyr)
- a_string <- read_file("nielsen_2016")
- split_lines <- strsplit(a_string, "\r\n")[[1]]
- split_cols <- strsplit(split_lines, "--")
- dat_frame <- ldply(split_cols)
- names(dat_frame) <- c("dma", "counties")
- write.csv(dat_frame, file = "dma_counties_2016.csv", row.names = F)
Add Comment
Please, Sign In to add comment