---
layout: post
title: "The tutorial you need to maximize your use of R's lists (CC276)"
blurb: "Benchmarking R's lists"
author: "PD Schloss"
date: 2024-04-22 11:00
comments: false
youtube: jryNWCxXvjM
start_hash: d565825528db5dea965b5ffd5da70d90053c7300
end_hash: a9d23f50d83d98e3055a503233598b28d7ffb4c8
---

What is your preferred method for building a list in R? Do you know its performance characteristics relative to other methods and the size of the list? In this tutorial, Pat compares 12 methods of building lists and compares them to their parallel approach for generating vectors and shows how they compare to each other. He uses the microbenchmark package to evaluate their speed for different sized vectors. Rcpp, purrr, and the base and magrittr pipes will also make an appearance. You'll likely be surprised by the results! This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/phylotyper/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/phylotyper/tree/{{page.end_hash}})
