Code Refactoring Services

A well written and organized script reduces maintenance costs by allowing faster debugging, and feature updating. We write code that reads like English to make the script easier to understand. We adhere to the best practices of coding on every chunk we refactor.

Does your code light a candle with a bazooka?

While code dependencies are inevitable, minimizing reliance on external packages reduces the risk of breaking changes and lowers maintenance costs. At Econometricus, we prioritize base R to avoid time-consuming updates and fragile, black-box scripts.

### Load Unnecessary Packages :(
stringr::str_replace()
dplyr::if_else()
dplyr::left_join()
dplyr::inner_join()
### Load Necessary Packages ;)
base::gsub()
base::ifelse()
base::setdiff()
base::match()
base::intersect()

Increase the readability and portability of your code with Econometricus Code Refactoring Services. We deliver clean, improved scripts that read like natural English—following a clear, top-down, left-to-right structure, just like a book. One line of code at a time.

###
### Realized Inflation Data by Quarters
###
Realized_Inflation$Quarter <- quarters(as.Date(Realized_Inflation$DATE))
Realized_Inflation$Year <- substr(as.Date(Realized_Inflation$DATE),0,4)
Realized_Inflation$Quarter_Year <- paste0(Realized_Inflation$Year,"-",Realized_Inflation$Quarter)
Realized_Inflation$Mean_Inflation <- mean(Realized_Inflation$Growth_Rate_Previous_Period)
Realized_Inflation$Median_Inflation <- median(Realized_Inflation$Growth_Rate_Previous_Period)

A simple wide-known trick of well aligned text, makes scanning for functions and steps more convenient decreasing time as well as frustration. We have been there.

Before / After

Recorder_Data <- Recorder_Data[, c("X.ATTOM.ID.","PropertyAddressFull","Mortgage1LenderNameFullStandardized","Mortgage1Amount","Mortgage1InterestRate","Sold_Price","Mortgage1Term","Year","Census_Tract_with_Zeroes")]

Try finding “Sold_Price” column name in both code chunks to realize how important and time-saving is to have a well organized code-base.

Recorder_Data <- Recorder_Data[, c("X.ATTOM.ID.",
"PropertyAddressFull",
"Mortgage1LenderNameFullStandardized",
"Mortgage1Amount",
"Mortgage1InterestRate",
"Sold_Price",
"Mortgage1Term",
"Year",
"Census_Tract_with_Zeroes")]

Book a Free Code Review

← Back

Thank you for your response. ✨

Subscribe to our Blog