April 2021
April 1
Before accepting regression model estimates, if multicollinearity is problematic (it doesn't necessarily have to be) needs to be checked.
— R Function A Day (@rfunctionaday) April 1, 2021
The {check_collinearity} function from {performance} 📦 offers pretty way to check this 📊https://t.co/sFMj9vbVIe#rstats #DataScience pic.twitter.com/xdrsVbz40f
April 2
Sometimes you wish to visually highlight only a certain portion of the data while retaining the full dataset for reference.
— R Function A Day (@rfunctionaday) April 2, 2021
The {gghighlight} function from the eponymous 📦 helps you do this effortlessly:https://t.co/eibrcjxQ1I#rstats #DataScience pic.twitter.com/TNUFlLnnMs
April 3
k-means is a popular clustering algorithm but has a disadvantage (in unsupervised context) that k should be picked in advance.
— R Function A Day (@rfunctionaday) April 3, 2021
The {kmeansruns} function from {fpc} 📦 aids by running k-means over a range of k and returns the best k:https://t.co/bBYsUmhrRz#rstats #DataScience pic.twitter.com/U0ecl17XT0
April 4
On a (Easter) Sunday, if you don't want to work but have to, you deserve some light entertainment for yourself.
— R Function A Day (@rfunctionaday) April 4, 2021
For such occasions, the {kittyR} function from the eponymous 📦 can do the trick 🐈https://t.co/74vJiwQSAx#rstats #DataScience pic.twitter.com/Cfq5azg6KQ
April 5
Often a survey platform might collapse multiple entries of data into a single column which then need to be separated into individual rows.
— R Function A Day (@rfunctionaday) April 5, 2021
The {separate_rows} function from {tidy} is designed to make this easy:https://t.co/rESDf7zU3i#rstats #DataScience pic.twitter.com/S1j8cjBaqX
April 6
Wordclouds help visualize word frequencies in qualitative work, and a dedicated geom in grammar of graphics framework can give more flexibility to create them.
— R Function A Day (@rfunctionaday) April 6, 2021
The {ggwordcloud} function from the eponymous 📦 provides such a geom 👌https://t.co/mk8DnYJY8p#rstats #DataScience pic.twitter.com/yiwFn7QHiR
April 7
As a developer or a user, if you are curious about how your favorite R package has performed (in terms of usage) over years, you can create an informative visualization using the {cranDownloads} function from {packageRank} 📦
— R Function A Day (@rfunctionaday) April 7, 2021
https://t.co/64DqUbmAFF#rstats #DataScience pic.twitter.com/GPGIgZiDrf
April 8
Often when we are reporting quantities (time, information, etc. units), we wish to report them in human-readable form.
— R Function A Day (@rfunctionaday) April 8, 2021
The {pretty_} function family from {prettyunits} 📦 is designed to do exactly this! ✅https://t.co/9QMWvZIODB#rstats #DataScience pic.twitter.com/ZUX6vbRNpF
April 9
Factor analysis (FA) can help reduce many features to a few latent features. But one first needs to check if data is suitable for FA.
— R Function A Day (@rfunctionaday) April 9, 2021
The {check_factorstructure} function from {parameters} provides an informative and verbose way 🔍https://t.co/MNQZMkum30#rstats #DataScience pic.twitter.com/hdeS0w3NJF
April 10
For pedagogical, research, etc. purposes, one may sometimes wish to create fake data.
— R Function A Day (@rfunctionaday) April 10, 2021
The {ch_} function family from {charlatan} 📦 supports creation of different types of data across multiple languages 🪄https://t.co/mERCQ6aCzf#rstats #DataScience pic.twitter.com/JClu9pnzqO
April 11
If you are fluent in {dplyr} and wish to learn more about {data.table}, it can be nifty to have a function that can provide a syntax translation between the two.
— R Function A Day (@rfunctionaday) April 11, 2021
The {show_query} function from {dtplyr} 📦 does just that! 🔄https://t.co/RKhCwjgNSt#rstats #DataScience pic.twitter.com/uj9NrXyNhY
April 12
Highest Density Interval (HDI) is a credible interval that contains the most probable effect values.
— R Function A Day (@rfunctionaday) April 12, 2021
The {hdi} function from {bayestestR} helps to compute and visualize HDI easily for posterior distributions from Bayesian models 📊https://t.co/ui1FRXgqzq#rstats #DataScience pic.twitter.com/w4TcHpaVOP
April 13
Google trends analytics is helpful in the study of global web search patterns.
— R Function A Day (@rfunctionaday) April 13, 2021
The {gtrends} function from {gtrendsR} 📦 helps extract and visualize this data for specified periods and geolocations 🔎https://t.co/yS01ELq5q4#rstats #DataScience pic.twitter.com/mhGTSXB2rN
April 14
Plots in the grammar of graphics framework are a combination of layers of geometric elements.
— R Function A Day (@rfunctionaday) April 14, 2021
The {layer_} function family in {ggplot2} 📦 extracts layer details, which can be helpful for testing and exploring aesthetic defaults 🗂https://t.co/mIq2G3qAo8#rstats #DataScience pic.twitter.com/jNUcLQ6nsC
April 15
In an age where virtual assistant programs have become ubiquitous, you may also wish to have one that helps you find solutions to common ggplot formatting problems.
— R Function A Day (@rfunctionaday) April 15, 2021
The {gghelp} function {ggx} mimics behavior of such an assistant 📝https://t.co/6VQzRqbrgp#rstats #DataScience pic.twitter.com/esK1W6xMEj
April 16
Although a no. of 📦s help assess validity of regression model assumptions visually, only a handful cover time series analysis.
— R Function A Day (@rfunctionaday) April 16, 2021
The {ggtsdiag} function from {ggfortify} 📦 provides a comprehensive diagnostic check for such models 📈https://t.co/iJaZ6bD6e1#rstats #DataScience pic.twitter.com/aeGlPV3IXn
April 17
Often one needs to report statistical analysis in a publication/report, and formatting them manually can be tedious and error-prone 📄
— R Function A Day (@rfunctionaday) April 17, 2021
The {report} function from the eponymous 📦 automates this process to follow best practices ✍️https://t.co/gAaRN4Qqr1#rstats #DataScience pic.twitter.com/59QS89HiLE
April 18
If your choice of color palette is not color-blind friendly, color differences in a plot may not be obvious to color-blind people.
— R Function A Day (@rfunctionaday) April 18, 2021
The {replacePlotColor} function from {colorBlindness} 📦 helps you replace colors with safe colorshttps://t.co/AN9lyD9fpc#rstats #DataScience pic.twitter.com/coudegYOfm
April 19
Exploratory data analysis often involves specifying and comparing multiple regression models.
— R Function A Day (@rfunctionaday) April 19, 2021
The {modelplot} function from {modelsummary} 📦 provides pretty dot-and-whisker plots to display/compare regression estimates from models:https://t.co/0vyzYY9bUy#rstats #DataScience pic.twitter.com/ZtkV0EUjVd
April 20
Next to statistical significance, we are often interested in the practical relevance of an effect.
— R Function A Day (@rfunctionaday) April 20, 2021
The {interpret_} function family from {effectsize} 📦 provides such interpretation guidelines, which can differ across disciplines 📏https://t.co/CaqThRABhy#rstats #DataScience pic.twitter.com/3ywbl2imPj
April 21
The {purrr::map_} functions apply a function to list elements.
— R Function A Day (@rfunctionaday) April 21, 2021
But what if one wants to apply a function not to each element of the list but to all combinations of elements?
The {xmap_} functions from {crossmap} 📦 do exactly this!https://t.co/9ITKhUqV9P#rstats #DataScience pic.twitter.com/woQenHnhfN
April 22
PCA is a popular method to reduce the dimensionality of multivariate data and a biplot is a useful visualization method for the same.
— R Function A Day (@rfunctionaday) April 22, 2021
The {fviz_pca_biplot} function from {factoextra} 📦 makes it effortless to make elegant biplots:https://t.co/DRGesAG4vq#rstats #DataScience pic.twitter.com/RB4BoCDp1S
April 23
Sometimes you just want to convert the source code from R script (.R) into a new Markdown (.md) document/report.
— R Function A Day (@rfunctionaday) April 23, 2021
The {spin} function from {knitr} 📦 makes this conversion effortless! 🪄https://t.co/cBaYSC5nc8#rstats #DataScience pic.twitter.com/u1kIa8Of9T
April 24
If one correlation is significant, while the other isn't, it's a fallacy to conclude that difference in correlations itself is statistically significant.
— R Function A Day (@rfunctionaday) April 24, 2021
The {cocor} function from eponymous 📦 helps to formally test this difference:https://t.co/9CjLNcqffG#rstats #DataScience pic.twitter.com/XiJ5OqIExv
April 25
Confusion matrix visualization helps assess the performance of a (binary or multi-class) classification algorithm.
— R Function A Day (@rfunctionaday) April 25, 2021
The {plot_confusion_matrix} function from {cvms} 📦 produces elegant and informative confusion matrix plots 🗄https://t.co/NHxGNS8XnD#rstats #DataScience pic.twitter.com/SZWvibYAQp
April 26
As trivial as combining multiple characters to form a single phrase sounds, the common solutions return outputs that are imperfect for human readers.
— R Function A Day (@rfunctionaday) April 26, 2021
The {combine_words} helper function from {knitr} 📦 fills in this gap! 🙌https://t.co/M0CgOUU0ed#rstats #DataScience pic.twitter.com/XuCNHf3BFi
April 27
Although a number of 📦s provide functions to visualize a one-way ANOVA design, few support visualizing more complex, multi-way ANOVA designs.
— R Function A Day (@rfunctionaday) April 27, 2021
The {afex_plot} function from {afex} 📦 is one such function ! 🙌📊https://t.co/3px5ySCzrd#rstats #DataScience pic.twitter.com/3g9hkZ3ySy
April 28
Markdown has a syntax that is enviable for its ease and simplicity. So one might naturally wish to use it for annotations in {ggplot2} plots.
— R Function A Day (@rfunctionaday) April 28, 2021
The {element_markdown} function from {ggtext} 📦 magically helps to do exactly this! 🎉https://t.co/54WpoyrVje#rstats #DataScience pic.twitter.com/irr8gRVaxf
April 29
If we have sensitive categorical data (e.g., gender, race, etc.), we might sometimes be required to anonymize them before carrying out any analysis.
— R Function A Day (@rfunctionaday) April 29, 2021
The {fct_anon} function from {forcats} 📦 helps exactly with this step 🗃️https://t.co/xsR3HipYqu#rstats #DataScience pic.twitter.com/C6apoc6fEP
April 30
Google's Tesseract (https://t.co/tJkaT2vH2j), a powerful optical character recognition engine, can extract text embedded in images from over 100 languages!
— R Function A Day (@rfunctionaday) April 30, 2021
The {ocr} function from {tesseract} 📦 provides access to this engine 👽https://t.co/H0vHvn59sQ#rstats #DataScience pic.twitter.com/g0GMKB9JEy