Block of code from R Studio used by Trevor Berreth to create the one-pagers. This particular block converts decimals to percentages for the final product.
Can programming be used to automate everyday tasks? When Trevor Berreth at Carolina Demography was tasked with creating one-page fact sheets for each North Carolina county, he knew that manually designing each one wasn’t an option. With 100 counties in North Carolina and each fact sheet drawing from over 120 data fields, Berreth decided to automate the process using R.
The Research Hub’s Data Analysis Librarian helped Berreth use R Markdown, an R package for turning analyses into documents, reports, or presentations. The final product consists of a dashboard, where pdf fact sheets can be downloaded for each county and the entire state. The pdfs include information such as demographics, educational attainment and more. More information about Berreth’s experience learning R and R Markdown can be found here.