#' Apply function to a list of objects
#'
#' @param lst A lst of objects/variables
#' @param FUN A function to be executed upon the objects/variables
#' @return A list where each element corresponds to the outputs from the function, and names after the named elements of supplied list
#' @export
applyFunToListOfObj <- function(lst, FUN, ...){
outLstOfVar <- list()
for(i in 1:length(lst)){
print(paste("Working on ",names(lst)[i],sep=""))
Obj_i <- lst[[i]]
Obj_i_new <- FUN(Obj_i, ...)
outLstOfVar <- lappend(outLstOfVar,Obj_i_new)
}
names(outLstOfVar) <- names(lst)
return(outLstOfVar)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.