Apply

Mapping Techniques to Maintain Data Frame Consistency in Base R

Introduction Maintaining data frame consistency within Base R can be difficult. The library purrr1 from the tidyverse solves this problem with its map_df() function. However, we can achieve similar results and expand upon them with base R functions. To do so, two methods will be used. Method 1: Use lapply(), data.frame(), and do.call() To replicate purrr’s map_df(), we use three functions: lapply() to apply the function to some data; data.