June 2021
June 1
Outliers are influential observations that can cause problems for (interpreting) regression models, and they need to be detected for further scrutiny.
β R Function A Day (@rfunctionaday) June 1, 2021
The {check_outliers} function from {performance} π¦ can do this effortlessly ποΈββοΈhttps://t.co/kb9ipoi0l7#rstats #DataScience pic.twitter.com/Qatg8YgQAx
June 2
Project Gutenberg is a digital library with > 65K full-texts freely available. Sometimes you may wish to query if a book you want to read is available π
β R Function A Day (@rfunctionaday) June 2, 2021
The {gutenberg_works} function from {gutenbergr} π¦ provides this info! πhttps://t.co/xxXL0wx3wQ#rstats #DataScience pic.twitter.com/jgGngCTmqk
June 3
Although visualizing variable distribution via violin plot is easy in {ggplot2}, we may wish to avoid redundant mirroring of the density plot.
β R Function A Day (@rfunctionaday) June 3, 2021
The {stat_halfeye} function from {ggdist} π¦ provides exactly such a geometric layer! πhttps://t.co/I3ohHjJG1s#rstats #DataScience pic.twitter.com/eVpC6OxEx9
June 4
For correlation hypotheses, one may wish to simultaneously visualize both the joint and the marginal distributions.
β R Function A Day (@rfunctionaday) June 4, 2021
The {ggscatterstats} function from {ggstatsplot} π¦ does this by default (with statistical summary as a plus) π https://t.co/09RGm3D8f5#rstats #DataScience pic.twitter.com/939n98ag9O
June 5
At times, we may wish to create "safe" versions of functions that notify us if the function fails but also doesn't error and stop the workflow that relies on it.
β R Function A Day (@rfunctionaday) June 5, 2021
The {safely} function from {purrr} π¦ creates such "safe" functions πͺhttps://t.co/TgO3VCFznT#rstats #DataScience pic.twitter.com/Au0O7G3Lgb
June 6
Sometimes we need to convert an HTML to a PDF, PNG, etc. π
β R Function A Day (@rfunctionaday) June 6, 2021
The {chrome_print} function from {pagedown} can do this either for a local file (including an Rmd file that outputs HTML) or for a URL π https://t.co/IqHMH3kBVz#rstats #DataScience pic.twitter.com/J5sGQVTDbt
June 7
Sometimes the data is missing because the output format doesn't repeat values until they change. Such missing values can be filled in using the next or the previous entry. π§±
β R Function A Day (@rfunctionaday) June 7, 2021
The {fill} function from {tidyr} does exactly this! πhttps://t.co/QTlw2j4luQ#rstats #DataScience pic.twitter.com/9YLldOUtrH
June 8
A test of practical equivalence checks if the effect sizes are equivalent to null effect (a range of values considered to be practically unimportant).
β R Function A Day (@rfunctionaday) June 8, 2021
The {equivalence_test} from {effectsize} π¦ performs and visualizes this test πhttps://t.co/r3sWIusHcH#rstats #DataScience pic.twitter.com/rurbfkD04l
June 9
Tables are typically presented outside of graphics. But sometimes we may wish to display them alongside graphics, and this requires making "graphical" tables.
β R Function A Day (@rfunctionaday) June 9, 2021
The {tableGrob} function from {gridExtra} π¦ can do exactly this! π€©https://t.co/yatEDnIiHJ#rstats #DataScience pic.twitter.com/obnLMJSSEh
June 10
A scatterplot matrix elegantly visualizes multi-dimensional data with variable pair graphs arranged in a matrix with shared scales.
β R Function A Day (@rfunctionaday) June 10, 2021
The {ggpairs} function from {GGally} π¦ provides an easy and flexible way to generate them! π https://t.co/liWHH9PAUe#rstats #DataScience pic.twitter.com/z94y7K7IMk
June 11
Sometimes you just want to quickly convert the source code from R script (.R) into a report (can be a markdown, PDF, HTML).
β R Function A Day (@rfunctionaday) June 11, 2021
The {stitch} function family from {knitr} π¦ makes this conversion effortless! π§Ά https://t.co/F7q6zYqn84#rstats #DataScience pic.twitter.com/bPwdrVMEOw
June 12
If data has grouped/clustered structure, we may wish to highlight this in a visualization. πͺΆ
β R Function A Day (@rfunctionaday) June 12, 2021
The {geom_mark_ellipse} function from {ggforce} π¦ provides a perfect geometric layer to achieve this by drawing an annotated ellipse! πͺhttps://t.co/CBfw7Uj52e#rstats #DataScience pic.twitter.com/iIkVhL6ZXc
June 13
Sometimes youβd wish to download fulltext for a paper to read from the comfort of R console. π‘
β R Function A Day (@rfunctionaday) June 13, 2021
The {ft_get} function from {fulltext} π¦ can do exactly this; you only need to provide a doi! πhttps://t.co/AL9zFqN1wj#rstats #DataScience pic.twitter.com/jnAShY92I4
June 14
If you have a script that takes a long time to run, you may wish to get notified when it finishes. β
β R Function A Day (@rfunctionaday) June 14, 2021
The {beep} function from {beepr} π¦ can do this by producing a sound of your choosing! πhttps://t.co/tXSziFWu88#rstats #DataScience pic.twitter.com/okF71yE6ZV
June 15
Significance-testing for regression models assumes that errors have constant variance.
β R Function A Day (@rfunctionaday) June 15, 2021
The validity of this key assumption can be statistically and visually checked using the {check_heteroscedasticity} function from {performance} π¦https://t.co/TOemt5pXes#rstats #DataScience pic.twitter.com/4y4txOtnSs
June 16
Sometimes we might have a dataframe containing information that we ideally prefer in a list.
β R Function A Day (@rfunctionaday) June 16, 2021
The {deframe} function from {tibble} π¦ can do the needed transformation to extract a list π§https://t.co/dsjo0w5aYD#rstats #DataScience pic.twitter.com/uRFlJMoJ0Q
June 17
While working with text data, we may wish to create page-styled visualizations (to highlight certain words, to provide a quick visual summary, etc.).
β R Function A Day (@rfunctionaday) June 17, 2021
The {ggpage_plot} function from {ggpage} π¦ creates them in {ggplot}-framework! πhttps://t.co/TW6OPH5otb#rstats #DataScience pic.twitter.com/CURqBhD9cU
June 18
Sometimes we may wish to print colorful output to the R terminal.
β R Function A Day (@rfunctionaday) June 18, 2021
The color functions (red, green, etc.) from {crayon} π¦ make this really easy (via ANSI escape codes)! π¨https://t.co/RGvmzBQR7B#rstats #DataScience pic.twitter.com/X7jGXxHb9h
June 19
Population pyramids help visualize the overall age distribution of a population and are useful across many fields (e.g., ecology).
β R Function A Day (@rfunctionaday) June 19, 2021
The {pyramid_chart} function from {ggcharts} π¦ provides an easy syntax to create them πhttps://t.co/vvhumXF3s5#rstats #DataScience pic.twitter.com/O7RB54NLnX
June 20
Sometimes youβd wish to download and install the needed softwares from the comfort of your R console itself. π‘
β R Function A Day (@rfunctionaday) June 20, 2021
The {install.} function family from {installr} π¦ can do exactly this only on Windows OS β¬https://t.co/MdlaWRGskO#rstats #DataScience pic.twitter.com/RQOgFGyJYS
June 21
Pie charts are a popular way to visualize categorical data, but making a well-labeled pie chart can be time-consuming.
β R Function A Day (@rfunctionaday) June 21, 2021
The {ggpiestats} function from {ggstatsplot} π¦ produces them easily (with additional statistical details) πhttps://t.co/8RAAjLUP7H#rstats #DataScience pic.twitter.com/Eqbsd7ACLN
June 22
If you have experience with object-oriented programming (OOP) languages, you may wish to learn its implementation in R. π©βπ»
β R Function A Day (@rfunctionaday) June 22, 2021
The first step would be to know object types in R, and the {otype} function from {sloop} π¦ makes this easy!https://t.co/cfl3iD4n9m#rstats #DataScience pic.twitter.com/avIaOGvlHC
June 23
Even if you know HTML, sometimes you may wish to generate the HTML code/tags using R itself.
β R Function A Day (@rfunctionaday) June 23, 2021
The tag builder function family from {htmltools} π¦ makes this straightforward!https://t.co/X0cN4XB0WC
Potentially also helpful for self-teaching HTML via R. π©βπ«#rstats #DataScience pic.twitter.com/Tv8jES7TYt
June 24
Significance-testing for ANOVAs assumes that all comparison groups have the same variance.
β R Function A Day (@rfunctionaday) June 24, 2021
The validity of this assumption can be statistically and visually checked using the {check_homogeneity} function from {performance} π¦! β https://t.co/YVlloAfSdo#rstats #DataScience pic.twitter.com/advuxCgV6t
June 25
While writing in RMarkdown, we may be required to embed local or remote assets to enrich the document.
β R Function A Day (@rfunctionaday) June 25, 2021
The {include_} function family from {knitr} π¦ makes this easy and also provides many advantages over Markdown syntax π§°https://t.co/3ffCSIRvCw#rstats #DataScience pic.twitter.com/gbOUCChpXX
June 26
While deciding to use a color palette, not only do we wish to know the hex color codes but also how the color looks.
β R Function A Day (@rfunctionaday) June 26, 2021
The {paletteer_d} function from {paletteer} π¦ does exactly this! π¨https://t.co/zNlTlQtytB
P.S. For continuous palettes: {paletteer_c}#rstats #DataScience pic.twitter.com/gASyRT94mg
June 27
For multivariate data, a radar chart helps visualize multiple quantitative variables on a two-dimensional chart. πΈοΈ
β R Function A Day (@rfunctionaday) June 27, 2021
The {ggRadar} function from {ggiraphExtra} π¦ makes it really easy to create static or interactive radar charts! πhttps://t.co/JXXAQbNOyE#rstats #DataScience pic.twitter.com/cHbCKDd8Ig
June 28
Sometimes R objects need to be compared (e.g.Β while implementing a caching strategy), and this can be done by creating unique hash digests for them. π΅οΈ
β R Function A Day (@rfunctionaday) June 28, 2021
The {digest} function from the eponymous π¦ does exactly this! 3β£2β£https://t.co/dFy9o3RpbC#rstats #DataScience pic.twitter.com/GJNB48TXGc
June 29
If data has grouped/clustered structure, we may wish to highlight this in a visualization. πͺΆ
β R Function A Day (@rfunctionaday) June 29, 2021
The {geom_mark_hull} function from {ggforce} π¦ provides a geometric layer to achieve this by annotating sets of points via hulls βοΈhttps://t.co/fnjCPTf2Ki#rstats #DataScience pic.twitter.com/wbvFiHaEyt
June 30
Clustering algorithms can often disagree on the number of clusters present in the data.
β R Function A Day (@rfunctionaday) June 30, 2021
To address this, the {n_clusters} function from {parameters} π¦ runs 28 different algorithms and suggests a number based on maximum consensus π€https://t.co/DIxPXIhhLg#rstats #DataScience pic.twitter.com/gMIT5jd1QO