Created
March 10, 2020 01:45
-
-
Save pcantalupo/8fdf1685b60caa88af5fbbb2b7aad9de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx) | |
library(readr) | |
library(dplyr) | |
mappings = read.xlsx("mappings.tsv.xlsx") %>% tbl_df() | |
registration = read.xlsx("Final Registration List.xlsx") | |
cols = gsub(" ", ".", mappings$FinalRegistrationColumnname) | |
registration = registration[,!grepl("^What", colnames(registration))] %>% | |
select(cols) %>% distinct() %>% arrange(Last.Name) %>% tbl_df() | |
registration | |
# change column names in Registration to expected col names for Import Spreadsheet | |
forImport = registration | |
colnames(forImport) = mappings$ImportSpreadsheet | |
forImport | |
forImport %>% count(City, State, `Postal Code`) %>% arrange(-n) | |
write_csv(forImport, "Import.csv", na="") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment