forked from lgatto/MSnbase
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This is only for later - once things are in place:
In the Spectrum constructors in R (like Spectra2_mz_sorted) if e.g. metadata is not provided you have different options to create the list of list:
meta_list <- replicate(n = 1000, list())
mlist <- list(list())
meta_list_2 <- mlist[rep(1, 1000)]The second option would be preferable:
library(microbenchmark)
microbenchmark(replicate(n = 1000, list()), mlist[rep(1, 1000)])
Unit: microseconds
expr min lq mean median uq
replicate(n = 1000, list()) 550.126 563.1315 593.64833 573.0880 587.253
mlist[rep(1, 1000)] 14.504 14.8945 15.79718 15.2915 15.910
max neval cld
991.453 100 b
43.616 100 a Same for data.frame:
dfl <- list(data.frame())
microbenchmark(replicate(n = 1000, data.frame()), dfl[rep(1, 1000)])
Unit: microseconds
expr min lq mean median
replicate(n = 1000, data.frame()) 10170.537 11250.9030 12045.73504 11662.1910
dfl[rep(1, 1000)] 11.465 13.2695 14.61273 14.2835
uq max neval cld
12635.1265 15908.483 100 b
15.7515 22.069 100 a Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels