September 2021
September 1
Sometimes we may wish to estimate density for priors and posteriors of a regression model.
โ R Function A Day (@rfunctionaday) September 1, 2021
The {estimate_density} function from {bayestestR} ๐ฆ computes and visualizes these estimates ๐งฎhttps://t.co/gm8Wf9qr3f#rstats #DataScience pic.twitter.com/SjuoAiuXPo
September 2
If you use {dplyr} and {tidyr} ๐ฆs to wrangle data, you may wish to see some feedback about what different operations did, especially in long piped chains.
โ R Function A Day (@rfunctionaday) September 2, 2021
The {tidylog} ๐ฆ functions do exactly this ๐https://t.co/MfpoUZoBRQ#rstats #DataScience pic.twitter.com/hOnonyFHzx
September 3
A cheatsheet is a helpful resource to have at hand while learning a new R package.
โ R Function A Day (@rfunctionaday) September 3, 2021
The {get_all_cheatsheets} function from {cheatsheet} ๐ฆ makes it convenient to download all available cheatsheets on your computer in one go! ๐https://t.co/CxW1EOoaLK#rstats #DataScience pic.twitter.com/CXkPpPWZ5d
September 4
Sometimes you may wish to display a collection of images in a {ggplot2} graph.
โ R Function A Day (@rfunctionaday) September 4, 2021
The {geom_point_img} function from {ggimg} ๐ฆ provides just the needed geometric layer! ๐ทhttps://t.co/YinETxrQdk#rstats #DataScience pic.twitter.com/rhB2jwgsZe
September 5
Sometimes you may wish to execute a computation in a clean new R process without affecting other R processes.
โ R Function A Day (@rfunctionaday) September 5, 2021
The {r} function from {callr} ๐ฆ does exactly this! โ๏ธhttps://t.co/CXYdyo3d1P#rstats #DataScience pic.twitter.com/2cBDDRC2nj
September 6
Cox regression model is widely used in medical research to assess the effect of several risk factors on survival time of patients.
โ R Function A Day (@rfunctionaday) September 6, 2021
The {ggcoxdiagnostics} function from {survminer} ๐ฆ can help visually assess goodness of model fit ๐งhttps://t.co/BzVW6ReYFm#rstats #DataScience pic.twitter.com/3z6D7FQgL9
September 7
Sometimes we may need to do high-quality conversion of pdf page(s) to image (png, jpeg, etc.) format.
โ R Function A Day (@rfunctionaday) September 7, 2021
The {pdf_convert} function from {pdftools} ๐ฆ provides the needed functionality ๐https://t.co/DgielR9zoQ#rstats #DataScience pic.twitter.com/bHKPNcnPLQ
September 8
Sometimes you may want to plot different probability distributions with parameters of interest.
โ R Function A Day (@rfunctionaday) September 8, 2021
The {ggdistribution} function from {ggfortify} ๐ฆ provides a convenient helper to do so! ๐https://t.co/8ue1b7Drh2#rstats #DataScience pic.twitter.com/aOHHeMT5KT
September 9
Sometimes we need to perform both addition and subtraction of a quantity (e.g.ย while computing confidence intervals of an estimate).
โ R Function A Day (@rfunctionaday) September 9, 2021
The plus-minus operator (%+-%) from {dipsaus} ๐ฆ can do this conveniently for various data types ๐งฎhttps://t.co/1Ia5zzsM9L#rstats #DataScience pic.twitter.com/JimL38L0Sl
September 10
While visualizing group differences, sometimes you may also wish to include some additional descriptive statistics in the plot itself.
โ R Function A Day (@rfunctionaday) September 10, 2021
The {ggsummarystats} function from {ggpubr} ๐ฆ provides a flexible way to do so! ๐https://t.co/DMzyXViicx#rstats #DataScience pic.twitter.com/lIrBWo1Gmz
September 11
{purrr} ๐ฆโs {map} and {map2} function families can apply a single- or two-argument functions to a list. But what if you want to apply a function with multiple arguments?
โ R Function A Day (@rfunctionaday) September 11, 2021
The {pmap_} function family addresses exactly this problem ๐https://t.co/FrCzOUFLtJ#rstats #DataScience pic.twitter.com/oSQRgS4ywS
September 12
Euler diagram, a way to visualize set relationships, is a generalization of Venn diagram since it relaxes the requirement that all set interactions be present.
โ R Function A Day (@rfunctionaday) September 12, 2021
The {euler} function from {eulerr} ๐ฆ easily produces these diagrams ๐https://t.co/7eM2ZqEeVG#rstats #DataScience pic.twitter.com/aEBXBdIdt2
September 13
While exploring data, one often needs a quick and easy way to create dot-and-whisker plots of coefficient estimates for regression models.
โ R Function A Day (@rfunctionaday) September 13, 2021
The {ggcoef_model} function from {GGally} ๐ฆ produces such plots with elegant defaults ๐คฉhttps://t.co/atW3RTPWEH#rstats #DataScience pic.twitter.com/j0Zj2fp50Q
September 14
Sometimes you may wish to take a snapshot of a webpage, an rmarkdown document, or a Shiny application from R itself.
โ R Function A Day (@rfunctionaday) September 14, 2021
The {*shot} function family from {webshot} ๐ฆ provides a convenient way to do so! ๐ธhttps://t.co/SR0NPM36Xl#rstats #DataScience pic.twitter.com/2IvYDAB3yo
September 15
If you use both R and python, sometimes you may wish to convert your Jupyter notebooks so that you can modify them further with {rmarkdown}.
โ R Function A Day (@rfunctionaday) September 15, 2021
The {convert_ipynb} function from {rmarkdown} ๐ฆ can do this conversion ๐https://t.co/6pnduEMAZg#rstats #DataScience pic.twitter.com/IxtlF0faKc
September 16
Dropbox is a popular file hosting service and we may sometimes wish to interact with this application from the comfort of R itself.
โ R Function A Day (@rfunctionaday) September 16, 2021
The {drop_*} function family from {rdrop2} ๐ฆ provides just the toolbox! ๐งฐ https://t.co/THtnR1fqB2#rstats #DataScience pic.twitter.com/AfrKlSlKCB
September 17
Sometimes we may need to standardize (z-score) data, i.e.ย express it in terms of standard deviation.
โ R Function A Day (@rfunctionaday) September 17, 2021
The {standardize} function from {datawizard} ๐ฆ easily computes them, and provides further customizations (e.g.ย robust variant)! ๐https://t.co/yavQlVXuey#rstats #DataScience pic.twitter.com/mNeyfbohSg
September 18
Slope graphs are a handy tool for visualizing trends in paired data with multiple observations.
โ R Function A Day (@rfunctionaday) September 18, 2021
The {newggslopegraph} function from {CGPfunctions} ๐ฆ provides a helper to quickly prepare such a graph! ๐https://t.co/Rw9BmRpPPc#rstats #DataScience pic.twitter.com/XCO6SOocTa
September 19
Compiling LaTeX to PDF can be troublesome; often due to missing LaTeX packages. We may wish that such packages are automatically installed, making compilation painless.
โ R Function A Day (@rfunctionaday) September 19, 2021
The {pdflatex} function from {tinytex} ๐ฆ does exactly this! ๐https://t.co/4Ga94fTm47#rstats #DataScience pic.twitter.com/JX6o9YAi1d
September 20
Like in SQL, we may sometimes wish to change rows in one dataset based on rows in another dataset.
โ R Function A Day (@rfunctionaday) September 20, 2021
The {rows_} function family in {dplyr} ๐ฆ provides this functionality! ๐https://t.co/uSpmlee90H#rstats #DataScience pic.twitter.com/mLTwGqKMvD
September 21
While visualizing distributions, boxplots can hide bimodality & violins can show non-existent data.
โ R Function A Day (@rfunctionaday) September 21, 2021
Sina plots, where points are jittered proportional to density, provide a good solution & {ggforce::geom_sina} supplies the layer! ๐https://t.co/BR5iiCcf6s#rstats #DataScience pic.twitter.com/IrYGYqXUtt
September 22
The coefficient of determination (R^2) provides an absolute goodness-of-fit index for a regression model and is used to assess performance.
โ R Function A Day (@rfunctionaday) September 22, 2021
The {r2} function from {performance} ๐ฆ computes it for a variety of regression models! ๐งฎhttps://t.co/y3qQQOXuRv#rstats #DataScience pic.twitter.com/pJCrx4MOP4
September 23
A common issue with watching movies with subtitle files is that they can be out of sync with each other.
โ R Function A Day (@rfunctionaday) September 23, 2021
The {srt_shift} function from {srt} ๐ฆ can help shift the dialogues to sync with video and write a new subtitle file! ๐ฅ๐ฟhttps://t.co/j5V6SnCfZ7#rstats #DataScience pic.twitter.com/JE234uj5e7
September 24
Hash tables can efficiently look up values irrespective of the size of the table.
โ R Function A Day (@rfunctionaday) September 24, 2021
The {hash} function from the eponymous ๐ฆ provides a hash-like data structure and the necessary methods for hash operations in native R style! ๐https://t.co/QrxzzANqFV#rstats #DataScience pic.twitter.com/b75HRHxS1m
September 25
The sunset funnel plot includes study-level power info and acts as a diagnostic tool in meta-analysis to examine the power studies had to detect an effect of interest.
โ R Function A Day (@rfunctionaday) September 25, 2021
The {metaviz::viz_sunset} function can easily create them! ๐ https://t.co/cqlXpmUh0f#rstats #DataScience pic.twitter.com/lf1Pefk5XH
September 26
Although visualizing variable distribution via boxplot is easy, we may wish to avoid redundant vertical mirroring of the distribution.
โ R Function A Day (@rfunctionaday) September 26, 2021
The {geom_half_boxplot} function from {gghalves} ๐ฆ provides exactly such a geometric layer! ๐https://t.co/0kfnVPtUWU#rstats #DataScience pic.twitter.com/2KqVyhOPIA
September 27
Item analysis, a psychometric technique, selects few items (from a large pool) to index a psychological construct.
โ R Function A Day (@rfunctionaday) September 27, 2021
The {tab_itemscale} function from {sjPlot} ๐ฆ carries out and produces elegant HTML tables for item analysis ๐งฝhttps://t.co/8Z5DzerVaU#rstats #DataScience pic.twitter.com/uIXZrVsr0Z
September 28
XML language is ubiquitous in storing and transporting a wide array of data structures and sometimes we may wish to work with it in R.
โ R Function A Day (@rfunctionaday) September 28, 2021
The {as_list} function from {xml2} ๐ฆ converts XML document nodes to a familiar R list! ๐https://t.co/OqvPGvv1Ce#rstats #DataScience pic.twitter.com/fddfsNc0z5
September 29
Even if you know markdown syntax well, sometimes you may wish to generate it algorithmically.
โ R Function A Day (@rfunctionaday) September 29, 2021
The {md_} function family from {gluedown} ๐ฆ can be of help here ๐คhttps://t.co/VXXO0Ce3Mu#rstats #DataScience pic.twitter.com/EklzKUpHkB
September 30
Out of curiosity or while working in a memory-constrained setting, sometimes you may wish to know roughly how much memory is being used by R.
โ R Function A Day (@rfunctionaday) September 30, 2021
The {mem_used} function from {lobstr} ๐ฆ provides such an estimate ๐https://t.co/SwebVXHUrx#rstats #DataScience pic.twitter.com/SbEWyUZdPl