r format(Sys.time(), "%d %B, %Y; %R")

Setup

knitr::opts_chunk$set(fig.width=12, fig.height=8, 
                      fig.path=paste0('Figures_/'), 
                      dev='pdf', 
                      echo=TRUE, warning=FALSE, message=FALSE, 
                      error=TRUE)
suppressWarnings(library('tidyverse'))
suppressWarnings(library('magrittr'))
suppressWarnings(library('knitr'))
suppressWarnings(library('RMetaTools'))
suppressWarnings(library(microbenchmark))
fname <- system.file("extdata", "deeptools3_matrix.gz", package = "RMetaTools")

load as tidy df

microbenchmark({df <- load_deeptoolsmatrix3(fname)}, times = 10)

load as matrix

microbenchmark({df <- load_deeptoolsmatrix3(fname, as.matrix=T)}, times = 10)

load as s3 struct

microbenchmark({df <- load_deeptoolsmatrix3(fname, as.S3=T)}, times = 10)

--> matrix and S3 are faster than tidy version and matrix marginally faster than S3

sessionInfo()


manschmi/RMetaTools documentation built on Dec. 14, 2021, 4:33 a.m.