#' mc_get_data_frame
#' return a data frame using parallel library
#'
#' @param input_filenames input files
#' @param sql_query SQL query
#'
#' @return a dataframe
#' @export
#' @import parallel
#' @importFrom data.table rbindlist
#'
#' @examples
mc_get_data_frame <- function(input_filenames, sql_query) {
n_cores <- detectCores()/2
n_cores <- min(length(input_filenames), n_cores)
my_list <- mclapply(input_filenames,
function(x) {
get_df_from_sqlite(x, sql_query)
},
mc.cores = n_cores)
my_list
rbindlist(my_list)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.