TidyDensity Powers Up with Data.table: Speedier Distributions for Your Data Exploration
code
benchmark
datatable
tidydensity
Author
Steven P. Sanderson II, MPH
Published
January 12, 2024
Calling all R enthusiasts who love tidy data and crave efficiency!
I’m thrilled to announce a major upgrade to the TidyDensity package that’s sure to accelerate your data analysis workflows. We’ve integrated the lightning-fast data.table package for generating tidy distribution data, resulting in a jaw-dropping 30% speed boost.
Here is one of the tests ran during development where v1 was the current and v2 was the version using data.table:
Faster Generation of Distribution Data: Whether you’re working with normal, binomial, Poisson, or other distributions, TidyDensity now produces results more swiftly than ever. This means less waiting and more time for exploring insights.
Flexible Output Formats: Choose the format that best suits your needs:
Tibbles for Seamless Integration with Tidyverse: Set .return_tibble = TRUE to receive the data as a tibble, ready for seamless interaction with your favorite tidyverse tools.
data.table for Enhanced Performance: Set .return_tibble = FALSE to harness the raw power of data.table objects for memory-efficient and lightning-fast operations.
Enjoy the Speed Boost, No Matter Your Choice: The speed enhancement shines through regardless of your preferred output format, as the data generation itself leverages data.table under the hood.
How to experience this boost
Update TidyDensity: Ensure you have the latest version installed: install.packages("TidyDensity")
Choose Your Output Format: Indicate your preference with the .return_tibble parameter:
# For a tibble:tidy_data <-tidy_normal(.return_tibble =TRUE)# For a data.table:tidy_data <-tidy_normal(.return_tibble =FALSE)
No matter which output you choose you will still enjoy the speedup because data.table is used to create the data and the conversion to a tibble is done afterwards if that is the output you want.
Ready to unleash the power of TidyDensity and data.table?
Dive into your next data exploration project and experience the efficiency firsthand! Share your discoveries and feedback with the community—we’re eager to hear how this upgrade empowers your analysis.