October 2021
October 1
Correspondence analysis extends PCA to summarizes and visualizes multivariate categorical data in two-dimension plots.
โ R Function A Day (@rfunctionaday) October 1, 2021
The {fviz_ca} function from {factoextra} ๐ฆ provides elegant ggplot2-based visualizations for this analysis! ๐https://t.co/mtFtXrE0VJ#rstats #DataScience pic.twitter.com/FT2vNH70Vx
October 2
Text comes in a variety of encodings, and many functions for reading in text assume UTF-8 encoding. But what if this assumption doesn't hold up?
โ R Function A Day (@rfunctionaday) October 2, 2021
In such cases, the {utf8_valid} function from {utf8} ๐ฆ can find the offending text ๐https://t.co/vwL09X0zrq#rstats #DataScience pic.twitter.com/cU8tkACV75
October 3
While exploring data, one often needs a quick and easy way to display distributions of coefficient estimates for regression models.
โ R Function A Day (@rfunctionaday) October 3, 2021
The {dwplot} function from {dotwhisker} ๐ฆ produces such plots easily and flexibly! ๐https://t.co/aHrGaAG8Kv#rstats #DataScience pic.twitter.com/IwGGnBQN82
October 4
In the hypothesis testing framework, sometimes we may wish to generate a distribution corresponding to our null hypothesis.
โ R Function A Day (@rfunctionaday) October 4, 2021
The {generate} function from {infer} ๐ฆ easily resamples observed data to create such a distribution! ๐https://t.co/39GlrUrqsp#rstats #DataScience pic.twitter.com/rt60yA7YFQ
October 5
Having stand-out comment lines decorated with bands of characters can make different sections of R scripts easy to identify and navigate.
โ R Function A Day (@rfunctionaday) October 5, 2021
The {xxx_*} function family from {ARTofR} ๐ฆ offers a collection of such comments ๐จhttps://t.co/in3KGiwDXs#rstats #DataScience pic.twitter.com/c75VrfhniD
October 6
Association rule mining is an unsupervised method to find attributes that frequently occur together in a dataset.
โ R Function A Day (@rfunctionaday) October 6, 2021
The {plot} method from {arulesViz} ๐ฆ can visualize found association rules in the ggplot2-framework โhttps://t.co/s4pUQAvqXA#rstats #DataScience pic.twitter.com/dDy9Fstgq1
October 7
A calendar-based graphic visualizes daily activities, but getting the data in the needed format can be a challenge.
โ R Function A Day (@rfunctionaday) October 7, 2021
The {frame_calendar} function from {sugrrants} ๐ฆ provides convenient syntax to format data in the right format ๐๏ธhttps://t.co/JZHB0oUb7q#rstats #DataScience pic.twitter.com/q5Vv5wcShM
October 8
Sometimes you have to present results from a regression model in a well-formatted table.
โ R Function A Day (@rfunctionaday) October 8, 2021
The {as_flextable} function from {flextable} ๐ฆ can easily produce such tables with rich details ๐https://t.co/trfvqzqhvp#rstats #DataScience pic.twitter.com/cXx7iyUXh6
October 9
Sometimes you may wish to sample only a portion of the data.
โ R Function A Day (@rfunctionaday) October 9, 2021
The {slice} function family from {dplyr} ๐ฆ provides helpers to do so โ๏ธhttps://t.co/4tt17FnvnM#rstats #DataScience pic.twitter.com/9e8pS7KjFn
October 10
In order to ensure reproducibility, we may want to include detailed session information in our report.
โ R Function A Day (@rfunctionaday) October 10, 2021
The {session_info} function from {sessioninfo} ๐ฆ creates such a log ๐https://t.co/C9RyxMnXNk#rstats #DataScience pic.twitter.com/QH0SkjztL6
October 11
If you use a function that outputs content that you often need to copy-paste, you may wish to do this programmatically than manually.
โ R Function A Day (@rfunctionaday) October 11, 2021
The {write_clip} function from {clipr} ๐ฆ allows you to do this! โ๏ธhttps://t.co/LI9QxOqguP#rstats #DataScience pic.twitter.com/CZM86KxLlL
October 12
Sometimes you may wish to customize how {ggplot2} axes are drawn (e.g.ย adding brackets).
โ R Function A Day (@rfunctionaday) October 12, 2021
The {coord_flex_*} function family from {lemon} ๐ฆ supports such customizations ๐https://t.co/DNHBbSx5Io#rstats #DataScience pic.twitter.com/SJzVPftyqQ
October 13
Often we may wish to compute descriptive and inferential statistics by giving different weights across data points.
โ R Function A Day (@rfunctionaday) October 13, 2021
The {weighted_*} function family from {sjstats} ๐ฆ provides familiar syntax to carry out weighted analysis ๐๏ธhttps://t.co/x9Ng6317As#rstats #DataScience pic.twitter.com/mEE7MIlkPE
October 14
Treemaps visualize nested proportions for multiple categorical variables by recursively nesting rectangles (area = proportion) inside each other.
โ R Function A Day (@rfunctionaday) October 14, 2021
The {geom_treemap} function from {treemapify} ๐ฆ supplies needed geometric layer! ๐ณhttps://t.co/i1Pc58pewr#rstats #DataScience pic.twitter.com/9ccyphWC76
October 15
Although often you can write data to a single CSV file, sometimes you may need to write several datasets to multiple Excel spreadsheets.
โ R Function A Day (@rfunctionaday) October 15, 2021
The {write_xlsx} function from {writexl} ๐ฆ provides an easy syntax to do so! ๐https://t.co/EsBmWyupeB#rstats #DataScience pic.twitter.com/9631CZzFM5
October 16
Sometimes we may wish to center variables (subtract from mean, i.e.) in a dataframe (e.g.ย to interpret interaction terms in regression analysis).
โ R Function A Day (@rfunctionaday) October 16, 2021
The {center} function from {datawizard} ๐ฆ does this flexibly 0๏ธโฃhttps://t.co/2KaDrn47w4#rstats #DataScience pic.twitter.com/KcfRGT1qF5
October 17
Sometimes you not only wish to create a visualization with {ggplot2} ๐ฆ, but also to add additional filters to it.
โ R Function A Day (@rfunctionaday) October 17, 2021
The {with_*} function family from {ggfx} ๐ฆ provides a rich collection of such filters! ๐ https://t.co/ekCrUTvFHV#rstats #DataScience pic.twitter.com/nnlVunnFyR
October 18
If the data to be wrangled is highly non-rectangular, you may wish to melt it down first and then wrangle it further.
โ R Function A Day (@rfunctionaday) October 18, 2021
The {melt_*} function family from {meltr} ๐ฆ allows you to do this โจ๏ธhttps://t.co/gYmWI1xIQA#rstats #DataScience pic.twitter.com/3nJcnrB9rP
October 19
If you work with text data, sometimes you might need to detect the text language.
โ R Function A Day (@rfunctionaday) October 19, 2021
The eponymous function from {franc} ๐ฆ can detect text from 310 languages! ๐ต๏ธโโ๏ธhttps://t.co/KOSWDsHQWH#rstats #DataScience pic.twitter.com/0KZbgor1iW
October 20
Sometimes you may wish to quickly prepare a frequency table but present it as a visualization.
โ R Function A Day (@rfunctionaday) October 20, 2021
The {ggtable} function from {GGally} ๐ฆ provides an easy syntax to do so in {ggplot2}-framework! ๐งฎ
https://t.co/NqgdhgImbo#rstats #DataScience pic.twitter.com/TqA4mQI06R
October 21
In order to speed up, you may want to return cached results if same inputs are provided to a computationally expensive function.
โ R Function A Day (@rfunctionaday) October 21, 2021
The {memoise} function from the eponymous ๐ฆ does exactly this! โฉ https://t.co/vT2edZhCZo#rstats #DataScience pic.twitter.com/BidZlofr8v
October 22
If you have a lot of overlapping data points, you could wish to simultaneously estimate their overlap and individuate them.
โ R Function A Day (@rfunctionaday) October 22, 2021
The {geom_pointdensity} function from {ggpointdensity} ๐ฆ provides the perfect geometric layer! ๐งนhttps://t.co/OeFMabDKZg#rstats #DataScience pic.twitter.com/tUtP6Jw6pI
October 23
Often you need to list all active processes on your system, but instead of using a task manager, you may wish to do it from R itself.
โ R Function A Day (@rfunctionaday) October 23, 2021
The {ps} function from the eponymous ๐ฆ creates an informative dataframe of active processes ๐https://t.co/KVrBiD4mUE#rstats #DataScience pic.twitter.com/ORYvnaTGV5
October 24
If you are fluent in R and wish to learn SQL, it can be nifty to have a function that can provide a syntax translation between the two.
โ R Function A Day (@rfunctionaday) October 24, 2021
The {translate_sql} function from {dbplyr} ๐ฆ provides such translations ๐https://t.co/cS6zPgdFNn#rstats #DataScience pic.twitter.com/Jafa31i673
October 25
If the data is stored in Excel spreadsheets and needs to be imported into R, we may sometimes wish to have it in the tidy data format.
โ R Function A Day (@rfunctionaday) October 25, 2021
The {xlsx_cells} function from {tidyxl} ๐ฆ makes such import straightforward ๐งhttps://t.co/hcAgiuyCON#rstats #DataScience pic.twitter.com/8VFCVEDaok
October 26
Donut charts are a popular way to visualize categorical data, but making a well-labelled donut chart can be time-consuming.
โ R Function A Day (@rfunctionaday) October 26, 2021
The {ggdonutchart} function from {ggpubr} ๐ฆ produces them easily! ๐ฉhttps://t.co/VdLvfSyFZH#rstats #DataScience pic.twitter.com/l1k5na75wL
October 27
If you do iterative analysis in list columns using {purrr} ๐ฆ, you understand the frustration of figuring out which iteration produces warnings or errors.
โ R Function A Day (@rfunctionaday) October 27, 2021
The {map_peacefully} wrapper function from {collateral} ๐ฆ comes to help ๐https://t.co/gqFb0FM8ov#rstats #DataScience pic.twitter.com/CGzrIMSwI6
October 28
Sometimes we may need to convert a {ggplot2} image in a vector graphics format to a raster image.
โ R Function A Day (@rfunctionaday) October 28, 2021
The {rasterise} function from {ggrastr} ๐ฆ can convert one or many ggplot2 layer(s) into a rasterized output ๐https://t.co/nrLWwoYwEi#rstats #DataScience pic.twitter.com/e3wI9Y5bvk
October 29
Google spreadsheets make it easy to create and edit files in real-time while collaborating online, and sometimes we may wish to access them from R.
โ R Function A Day (@rfunctionaday) October 29, 2021
The {read_sheet} function from {googlesheets4} ๐ฆ provides a way to do so ๐https://t.co/dj4tkk9My2#rstats #DataScience pic.twitter.com/zHFgcWqNxf
October 30
If you work a lot with time-of-day data, the {hms} function from the eponymous ๐ฆ provides a convenient way to construct and store them in a dataframe, and has consistent coercion rules ๐ฐhttps://t.co/0ViYWZrGLX#rstats #DataScience pic.twitter.com/jbwyxuzLiC
โ R Function A Day (@rfunctionaday) October 30, 2021
October 31
If you have a lot of overlapping data points, you could wish to visualize their density by plotting points next to each other.
โ R Function A Day (@rfunctionaday) October 31, 2021
The {geom_beeswarm} function from {ggbeeswarm} ๐ฆ provides the perfect geometric layer! ๐https://t.co/YCc94sGUTN#rstats #DataScience pic.twitter.com/rbdaQtqqqB