data manipulation

Chunking your csv

Sometimes due to limitations of software, file uploads often have a row limit. I recently encountered this while creating texting campaigns using Relay. Relay is a peer-to-peer texting platform. It has a limitation of 20k contacts per texting campaign. This is a limitation when running a massive Get Out the Vote (GOTV) texting initiative. In order to solve this problem, a large csv must be split into multiple csv’s for upload.

Reading Multiple csvs as 1 data frame

In an earlier posting I wrote about having to break a single csv into multiple csvs. In other scenarios one data set maybe provided as multiple a csvs. Thankfully purrr has a beautiful function called map_df() which will make this into a two liner. This process has essentially 3 steps. Create a vector of all .csv files that should be merged together. Read each file using readr::read_csv() Combine each dataframe into one.