I would like to rbind a list of data.frame and transform NULL elements into NA using R. Consider the following example,
rbind
list
data.frame
NULL
Start with transforming the NULL elements:
l <- lapply(l, function(x) if(is.null(x)) data.frame(C1 = NA) else x) dplyr::bind_rows(l) # C1 C2 #1 1 2 #2 NA NA #3 3 NA