May 2021
May 1
In {ggplot2}, the missing values are removed by default, but sometimes we may wish to visualize them to see if there is a pattern in missingness.
β R Function A Day (@rfunctionaday) May 1, 2021
The {geom_miss_point} function from {naniar} π¦ offers exactly this functionality πhttps://t.co/zJrYSMhnX4#rstats #DataScience pic.twitter.com/IrXFHoLVG1
May 2
While exploring data, one often needs a quick and easy way to create dot-and-whisker plots of coefficient estimates (or other quantities) for regression models.
β R Function A Day (@rfunctionaday) May 2, 2021
The {ggcoefstats} function from {ggstatsplot} π¦ offers one such optionhttps://t.co/e4iZpPoNIC#rstats #DataScience pic.twitter.com/suxiOKjuLo
May 3
Not all functions can properly deal with labelled data, which can cause problems for data analysis. So often one may wish to just remove all labels.
β R Function A Day (@rfunctionaday) May 3, 2021
The {remove_all_labels} function from {sjlabelled} π¦ does exactly this βοΈhttps://t.co/9mJHPTRlVD#rstats #DataScience pic.twitter.com/dt6Pbfkn58
May 4
The {ggplot2} syntax to carry out few common routines (e.g, changing legend position, axes, etc.) can be surprisingly hard to remember.
β R Function A Day (@rfunctionaday) May 4, 2021
The {easy_} function family from {ggeasy} π¦ provides memorable shortcuts for such routines πhttps://t.co/vqFYzcvxKZ#rstats #DataScience pic.twitter.com/eZvdrDwmNf
May 5
Google Scholar is an essential platform to organize one's scholarly research output.
β R Function A Day (@rfunctionaday) May 5, 2021
The {get_} function family from {scholar} π¦ provides various helpers to extract information about the scholar, publications, citations, etc. π§ͺhttps://t.co/ndoPs9Yy8S#rstats #DataScience pic.twitter.com/lAMo79rZu3
May 6
Linear and linear mixed-effects models assume normally distributed residuals and random effects.
β R Function A Day (@rfunctionaday) May 6, 2021
The validity of the assumption can be statistically and visually checked using the {check_normality} function from {performance} π¦! πhttps://t.co/7XbOrSrYxq#rstats #DataScience pic.twitter.com/AK7AX7iF6o
May 7
Often we wish to append visualizations of regression model estimates with a tabular summary of inferential statistics.
β R Function A Day (@rfunctionaday) May 7, 2021
The {forest_model} function from {forestmodel} π¦ satisfies these requirements via an informative forest plot π³https://t.co/YYD6dEJXSM#rstats #DataScience pic.twitter.com/rSEodymQx4
May 8
Post reproducibility crisis news, replications are on the rise across disciplines. This has led to a need to compare multiple studies.
β R Function A Day (@rfunctionaday) May 8, 2021
To this end, the function {sci_figure} from {scifigure} π¦ proves to be a helpful visual tool βοΈhttps://t.co/GnwtwoUcar#rstats #DataScience pic.twitter.com/TXbndnA0Bu
May 9
Sometimes the data contain implicitly missing values and one may wish to make them explicit by completing missing information.
β R Function A Day (@rfunctionaday) May 9, 2021
The {complete} function from {tidyr} π¦ does exactly this! πhttps://t.co/tHbK4YAJlZ#rstats #DataScience pic.twitter.com/xbDCkW0kLG
May 10
Although {patchwork} π¦'s arithmetic syntax (
β R Function A Day (@rfunctionaday) May 10, 2021+
,*
, etc.) to combine plots together is extremely easy and intuitive, it can be difficult to use programmatically.
The {wrap_plots} function is the perfect alternative solution!π‘https://t.co/AGLkfbPUja#rstats #DataScience pic.twitter.com/fJS5V9weJ3
May 11
Sometimes one may wish to include plots or visualizations in a table, e.g.Β to show the distribution of a variable.
β R Function A Day (@rfunctionaday) May 11, 2021
The {spec_} function family from {kableExtra} π¦ make doing so effortless πhttps://t.co/X4YY8Drm7C#rstats #DataScience pic.twitter.com/9HRDTxEpB8
May 12
ROPE defines part of the posterior distribution practically equivalent to a null effect and is useful for hypothesis testing.
β R Function A Day (@rfunctionaday) May 12, 2021
The {rope} function from {bayestestR} π¦ helps calculate and visualize it for Bayesian regression models:https://t.co/mfXACyKOfC#rstats #DataScience pic.twitter.com/W2iL072RP5
May 13
Sometimes we might need to convert numbers into English words (e.g., for assistant systems to read them out loud). π’
β R Function A Day (@rfunctionaday) May 13, 2021
The {numbers_to_words} function from {xfun} π¦ makes this routine effortless and customizable π’https://t.co/l2mYGmQGnx#rstats #DataScience pic.twitter.com/B9atDLK3nQ
May 14
The GardnerβAltman mean difference plot simultaneously displays the raw data and highlights the group difference estimate π
β R Function A Day (@rfunctionaday) May 14, 2021
The {mean_diff} function from {dabestr} π¦ creates such plots for two or multiple groups easily βοΈhttps://t.co/dhtg2Nh62r#rstats #DataScience pic.twitter.com/fjv2Vkpi19
May 15
For regression analysis with big datasets, we may at times wish to reduce memory assigned to model objects.
β R Function A Day (@rfunctionaday) May 15, 2021
The {axe_} function family from {butcher} π¦ offer ways to remove different parts of the model object to make it leaner ποΈhttps://t.co/ayY86U0zOy#rstats #DataScience pic.twitter.com/9CIU1NSqKU
May 16
During exploratory phase, we may wish to visualize and model data quickly, thoroughly, and iteratively βΏ
β R Function A Day (@rfunctionaday) May 16, 2021
The {ggbetweenstats} function from {ggstatsplot} π¦ facilitates this for one-way design via plots with statistical details πhttps://t.co/fQkmmLSOh3#rstats #DataScience pic.twitter.com/uxsJ8Odv5b
May 17
One often needs to compare two values on the same axis (e.g.Β pre-and post-treatment scores) and a dumbbell chart is an efficient way to visualize such comparison.
β R Function A Day (@rfunctionaday) May 17, 2021
The {dumbbell_chart} function from {ggcharts} π¦ creates them easily:https://t.co/Y6YGS0h0DS#rstats #DataScience pic.twitter.com/Wpwey00gGV
May 18
Programming is a challenging task and we - as a teacher, a collaborator, a developer, etc. - might wish to add a touch of encouragement to this activity sometimes.
β R Function A Day (@rfunctionaday) May 18, 2021
The {praise} function from the eponymous π¦ can be of help here πhttps://t.co/wImExbbaT7#rstats #DataScience pic.twitter.com/1SnLZ7ctS7
May 19
After model-fitting, we often need to convert model objects into a dataframe, either for reporting or for visualizations. π
β R Function A Day (@rfunctionaday) May 19, 2021
The {model_parameters} function from the {parameters} π¦ does this for many regression model objects πhttps://t.co/4jOHsZDCaz#rstats #DataScience pic.twitter.com/uI7sUSF0bz
May 20
In modern scientific work, the traditional credit assignment systems seem outmoded, and a contributions table is better suited.
β R Function A Day (@rfunctionaday) May 20, 2021
The {generate} function from {contribution} π¦ can easily generate such tables in ggplot2-framework π’https://t.co/FCTli0Ht1f#rstats #DataScience pic.twitter.com/IqcLPMFxOa
May 21
If you are fluent in {dplyr} and wish to learn how to write SQL queries, it can be nifty to have a function that can provide a syntax translation between the two.
β R Function A Day (@rfunctionaday) May 21, 2021
The {show_query} function from {dbplyr} π¦ does just that! πhttps://t.co/GAjWk5qfVC#rstats #DataScience pic.twitter.com/qxOAPD4PAX
May 22
While working with a directory, we sometimes need to get more information about its contents.
β R Function A Day (@rfunctionaday) May 22, 2021
Instead of using the terminal, one can simply use the {dir_ls} function from {fs} π¦ to return a richly informative summary πhttps://t.co/s0UxLxPykG#rstats #DataScience pic.twitter.com/kAzYf2jPfB
May 23
During analysis, model selection may involve specification and comparison of multiple models.
β R Function A Day (@rfunctionaday) May 23, 2021
The {compare_performance} function from {performance} π¦ creates tabular + graphical summaries comparing performance indices for models π₯https://t.co/6cAI5ZbNkl#rstats #DataScience pic.twitter.com/CxyfyRCCHY
May 24
While writing functions that print text to the user's terminal or console, we may wish to construct a pleasant command-line interface.
β R Function A Day (@rfunctionaday) May 24, 2021
The {cli_} function family from {cli} π¦ provides a collection of tools to make it pretty π https://t.co/HJeQ6MBgue#rstats #DataScience pic.twitter.com/ZJZNBP5SAa
May 25
While teaching or reporting methods, we may sometimes wish to report LaTeX equations for regression models, which can be frustrating and time-consuming.
β R Function A Day (@rfunctionaday) May 25, 2021
The {extract_eq} function from {equatiomatic} π¦ makes this really easy! πhttps://t.co/LyQ9bMxal0#rstats #DataScience pic.twitter.com/mlghSLFeGJ
May 26
Either due to reading or formatting errors, sometimes data entries that belong together in a cell might break off across rows.
β R Function A Day (@rfunctionaday) May 26, 2021
The {unbreak_vals} function from {unheadr} π¦ makes it easy to join them using regular expressions π©Ήhttps://t.co/gouxjvPows#rstats #DataScience pic.twitter.com/3a4ZA73xxP
May 27
Bar charts are a good way to visualize categorical data but making a well-labeled bar chart can be time-consuming.
β R Function A Day (@rfunctionaday) May 27, 2021
The {ggbarstats} function from {ggstatsplot} π¦ easily produces such a chart (with additional statistical details) πhttps://t.co/dNl2IJAJX3#rstats #DataScience pic.twitter.com/0UySWaMxei
May 28
A common data wrangling routine involves checking for presence or absence of certain combinations when the data have combinatorial structure.
β R Function A Day (@rfunctionaday) May 28, 2021
The {expand} function from {tidyr} π¦ does exactly this! πhttps://t.co/oj3THZs4RW#rstats #DataScience pic.twitter.com/SjHZo7bpxv
May 29
Although adding horizontal and vertical lines to {ggplot2} is easy, sometimes we need to add them both and with multiple intercepts.
β R Function A Day (@rfunctionaday) May 29, 2021
The {geom_vhlines} function from {ggpp} π¦ provides a perfect geometric layer to do so quickly! β‘οΈhttps://t.co/gNfzDhRdhu#rstats #DataScience pic.twitter.com/1oA1ZMWDKI
May 30
Across projects, we may have a similar directory structure and, therefore, we may prefer to create directories algorithmically over manually.
β R Function A Day (@rfunctionaday) May 30, 2021
The {dir_create} function from {fs} π¦ is perfect for safely doing this! ποΈhttps://t.co/SvS78Z0hIN#rstats #DataScience pic.twitter.com/uHEXy3n1N6
May 31
The {latex2exp} π¦ is useful to convert LaTeX equations to Rβs {plotmath}. But what if we instead want to do the opposite: convert {plotmath} expressions to LaTeX?
β R Function A Day (@rfunctionaday) May 31, 2021
The {expr2latex} function from {simsalapar} π¦ does exactly this! πhttps://t.co/MvVrIEOdwe#rstats #DataScience pic.twitter.com/kSMSdp4gIC