Albert Rapp Profile Banner
Albert Rapp Profile
Albert Rapp

@rappa753

12,651
Followers
133
Following
1,269
Media
3,673
Statuses

๐ŸŽ“ Math PhD student & freelancer ๐Ÿ‘จโ€๐Ÿซ Bite-sized insights on dataviz, web dev & data science with R at

Joined July 2021
Don't wanna be here? Send us removal request.
Pinned Tweet
@rappa753
Albert Rapp
1 year
Even though I've kept this tweet streak going for quite some time, I'm focusing on a new platform now . I will stop tweeting as soon as my scheduled tweets are over. If you want to see more of my content, you can join me via the link in the thread below ๐Ÿ‘‡
@rappa753
Albert Rapp
1 year
372 days of daily tweeting got me: ~ 9,300 new followers ~ 10,000,000 impressions Guess I have to do the same thing on the "business people" platform again ๐Ÿคท Come find me there as I'm going to use it for more in-depth contentโœŒ๏ธ
Tweet media one
2
0
24
5
1
9
@rappa753
Albert Rapp
1 year
This book will give you superpowers: R for Data Science 2 Years ago, I started my #rstats journey with this book. And since then, I've used what this book taught me every single day. Absolutely best place to get started with R. And it's free. ๐Ÿฅณ
Tweet media one
39
735
3K
@rappa753
Albert Rapp
2 years
Data cleaning is tedious. But it's much easier with the {janitor} package. Especially if you work with Excel files. Here are 5 underrated features from {janitor}. #rstats
24
343
2K
@rappa753
Albert Rapp
2 years
Ever heard of logistic regression? Or Poisson regression? Both are generalized linear models (GLMs). They're versatile statistical models. And by now, they've probably been reframed as super hot #MachineLearning . You can brush up on their math with this ๐Ÿงต. #rstats #Statistics
19
231
1K
@rappa753
Albert Rapp
2 years
You can step up your data visualization game with {ggiraph} & {patchwork}. Two premier tools for creating interactive, connected plots with click events and tool-tips. (And they're super easy to use too.) Code: #rstats #dataviz
12
161
985
@rappa753
Albert Rapp
1 year
Need a quick data summary? gt_plt_summary() from {gtExtras} is your friend ๐Ÿฅณ #rstats
Tweet media one
11
152
996
@rappa753
Albert Rapp
1 year
Data cleaning is tedious. But it's much easier with the {janitor} package. Especially if you work with Excel files. Here are 5 underrated features from {janitor}. #rstats
8
129
931
@rappa753
Albert Rapp
1 year
Correlation matrices are super hard to read. Instead, I like to use lollipop charts. Left: Correlation Right: Lollipops
Tweet media one
Tweet media two
19
93
896
@rappa753
Albert Rapp
1 year
Three steps to use color in your title instead of wasting space on a huge legend.
Tweet media one
6
61
770
@rappa753
Albert Rapp
2 years
Here's a simple {ggplot2} + {dplyr} combo for using colors: 1๏ธโƒฃ Create a new column with color names using case_when() 2๏ธโƒฃ Use new column in aes() and add a scale_color_identity() layer. Great trick to draw your reader's attention to specific parts of your plot. #rstats
Tweet media one
Tweet media two
Tweet media three
5
64
645
@rappa753
Albert Rapp
1 year
This book will give you superpowers: R for Data Science 2 Years ago, I started my #rstats journey with this book. And since then, I've used what this book taught me every single day. Absolutely best place to get started with R. And it's free. ๐Ÿฅณ
Tweet media one
13
90
651
@rappa753
Albert Rapp
2 years
In my first #rstats class, students loved the dinosaur from the dataSaurus package. One student even asked for more dinosaurs in class, and I couldn't resist! ๐Ÿคช I searched for dinosaur images, extracted coordinates and started plotting. So, here are more ggplot dinosaurs ๐Ÿฆ•๐Ÿฆ–
Tweet media one
10
61
632
@rappa753
Albert Rapp
2 years
The #rstats ecosystem makes splitting a stacked bar plot simple. ๐Ÿฅณ This way, comparing groups is sooo much easier! ๐Ÿ‘Œ๐Ÿฝ โœ‚๏ธ Split stacked bars with facet_wrap() ๐Ÿชข Combine splits with totals via {patchwork} Code: Details in thread ๐Ÿงต #dataviz
Tweet media one
6
88
608
@rappa753
Albert Rapp
2 years
BEFORE - Standard bar chart - No clue what the message is AFTER - Bar chart with nuanced color use - Informs your reader about key insights & actions The latter is actually pretty easy to pull off. At the end of this step-by-step guide, you can do that too. #rstats #dataviz
Tweet media one
11
80
544
@rappa753
Albert Rapp
1 year
Also a very neat summary table. Thanks to @JoelGires for pointing me to the {summarytools} package and it's `dfSummary()` function.
Tweet media one
@rappa753
Albert Rapp
1 year
Need a quick data summary? gt_plt_summary() from {gtExtras} is your friend ๐Ÿฅณ #rstats
Tweet media one
11
152
996
9
63
537
@rappa753
Albert Rapp
2 years
Want to relabel your data with #rstats ? Here are 3 ways to do that: 1๏ธโƒฃ case_when(), 2๏ธโƒฃ case_match(), 3๏ธโƒฃ if_else() + str_remove_all() + regex. Spoiler alert: one involves much less typing than the others. Code:
Tweet media one
Tweet media two
Tweet media three
Tweet media four
14
58
508
@rappa753
Albert Rapp
1 year
R makes it dead-simple to use some of the most effective dataviz principles. Here are six principles that are so easy that any ggplot beginnerโ€™s course should teach them.
8
65
509
@rappa753
Albert Rapp
3 years
The fun thing about getting better at #ggplot2 is that you begin to mimick other #dataviz . Here is a practice #rstats info graphic I created after seeing a similar infographic from @EatSmarter_de Original graphic, making of, comments and some ressources below โฌ‡๏ธ๐Ÿงต
Tweet media one
5
86
489
@rappa753
Albert Rapp
2 years
Next time you're creating a bar plot, try using a lollipop chart. They're a lightweight version of bars. With #rstats , lollipops are easy to create by replacing: geom_col() โฌ‡๏ธ geom_point() + geom_segment() Full code:
Tweet media one
Tweet media two
11
49
492
@rappa753
Albert Rapp
2 years
A really cool #rstats package is {geomtextpath}. It does exactly what it says. Write texts along a path. That's how I've created the text in this plot. Code Package and many more beautiful examples at
Tweet media one
2
77
448
@rappa753
Albert Rapp
1 year
Sometimes people ask me if I can do one-on-one R tutoring. Sure I can. But then my hourly rate applies. And there are many amazing *free* resources. Want to try them first? Here are a few that I recommend. #rstats
11
100
449
@rappa753
Albert Rapp
2 years
Instead of using a big legend in your plot, try coloring the words in your title. 3 steps to do that with #rstats : 1๏ธโƒฃ Use Markdown in your title with {ggtext} and theme() 2๏ธโƒฃ Create a text variable that wraps words into <span color="..."></span> 3๏ธโƒฃ Use that variable in labs()
Tweet media one
Tweet media two
9
49
440
@rappa753
Albert Rapp
1 year
There's an #rstats package for everything. With {ggbump}, it's dead-simple to create regular bump charts. (Great for rankings over time) ๐Ÿ”€ With some work, you can even transform them to ribbon bump charts. ๐Ÿ‘ท (Full code below)
Tweet media one
5
68
430
@rappa753
Albert Rapp
2 years
Confession: I used to suck at #rstats . ๐Ÿ™ˆ But teaching a hands-on university course forced me to up my game. I read a ton of resources on stats/ML with R and compiled them into one book. And now you can use it too! Check out to level up your R skills.
Tweet media one
9
68
431
@rappa753
Albert Rapp
2 years
A lot of people create reports with tables in Word and PowerPoint. {flextable} let's you do all the number crunching in #rstats and then export it to Word and PowerPoint. Work in R. Communicate in MS Office. That way, everyone can use your work.
Tweet media one
Tweet media two
11
59
409
@rappa753
Albert Rapp
2 years
Two things every {ggplot2} course should teach: 1๏ธโƒฃ Use proper labels and create a title with labs() 2๏ธโƒฃ Increase the text size with theme_grey(base_size = ...) Just two lines of code. But a considerable amount of respect for your future audience (which has to read your graph).
Tweet media one
Tweet media two
Tweet media three
9
52
398
@rappa753
Albert Rapp
2 years
Creating calendar plots with #rstats is surprisingly easy. ๐Ÿ“… Handling dates: {lubridate} and {stringi} (for week of month) ๐ŸŽจ Plotting: geom_tile() and facet_wrap() Code: #dataviz
Tweet media one
5
47
391
@rappa753
Albert Rapp
2 years
๐Ÿ’Ž๐Ÿ’Ž๐Ÿงต๐Ÿงต 5 hidden gems from well-known #rstats packages to spice up your #dataviz game. (with many code examples from the R twitter community)
14
68
374
@rappa753
Albert Rapp
2 years
Forget regular heat maps. Use bubbles on a grid instead ๐Ÿ”ต ๐ŸŸข ๐Ÿคฏ A short #dataviz thread ๐Ÿงต ๐Ÿงต #rstats #ggplot2 1/8
Tweet media one
15
46
377
@rappa753
Albert Rapp
2 years
I used to spend hours trying to figure out how to export my ggplots. Text sizes were always messed up when I used ggsave(). ๐Ÿ˜ฉ Once I learned about the {camcorder} package that problem was gone. Here's a demo of how I use it. #rstats
Tweet media one
6
46
387
@rappa753
Albert Rapp
1 year
Here's a simple {ggplot2} + {dplyr} combo for using colors: 1๏ธโƒฃ Create a new column with color names using case_when() 2๏ธโƒฃ Use new column in aes() and add a scale_color_identity() layer. Great trick to draw your reader's attention to specific parts of your plot. #rstats
Tweet media one
Tweet media two
Tweet media three
5
53
389
@rappa753
Albert Rapp
2 years
{patchwork} is one of my favorite #rstats packages. It's dead-simple to arrange multiple plots. "Add" plots to put them side-by-side "Divide" to stack them. Find out more in the docs () or my blog ()
Tweet media one
Tweet media two
9
61
386
@rappa753
Albert Rapp
2 years
{ggcharts} looks very promising. I love the simplicity with which it can create lollipop charts and dumbbell charts. #rstats
Tweet media one
Tweet media two
7
36
369
@rappa753
Albert Rapp
2 years
Duplicate code sucks! Avoid copy-and-pasting your code and wrap it into a function instead. It's dead-simple with powerful tools like curly-curly and dot-dot-dot (works even for ggplot or dplyr code.) Learn how to do this in 150 seconds with my new video (link below) #rstats
Tweet media one
9
55
366
@rappa753
Albert Rapp
2 years
If there's one supremely useful function I can't live without anymore, it's clean_names() from {janitor}. Ain't nobody got time for using pesky `` just to pick a badly named column. What's your function that you use every time? #rstats
Tweet media one
Tweet media two
14
34
368
@rappa753
Albert Rapp
1 year
{patchwork} is one of my favorite #rstats packages. It's dead-simple to arrange multiple plots. "Add" plots to put them side-by-side "Divide" to stack them. Find out more in the docs () or my blog ()
Tweet media one
Tweet media two
6
43
366
@rappa753
Albert Rapp
2 years
The #rstats ecosystem makes splitting a stacked bar plot simple. ๐Ÿฅณ This way, comparing groups is sooo much easier! โœ‚๏ธ Split stacked bars with facet_wrap() ๐Ÿชข Combine splits with totals via {patchwork} Code: Details in thread #dataviz
Tweet media one
3
54
355
@rappa753
Albert Rapp
1 year
Want to relabel your data with #rstats ? Here are 3 ways to do that: 1๏ธโƒฃ case_when(), 2๏ธโƒฃ case_match(), 3๏ธโƒฃ if_else() + str_remove_all() + regex. Spoiler alert: one involves much less typing than the others.
Tweet media one
Tweet media two
Tweet media three
Tweet media four
9
59
356
@rappa753
Albert Rapp
1 year
Want to know more about machine learning? Here's a book recommendation for you: Machine Learning with R by Brett Lantz It's a great book for learning the most important concepts and seeing how it can be done with #rstats . Here are a few more details:
Tweet media one
4
68
365
@rappa753
Albert Rapp
2 years
There's an #rstats package for everything. With {ggbump}, it's dead-simple to create regular bump charts. (Great for rankings over time) ๐Ÿ”€ With some work, you can even transform them to ribbon bump charts. ๐Ÿ‘ท Code:
Tweet media one
5
49
340
@rappa753
Albert Rapp
1 year
You can step up your data visualization game with {ggiraph} & {patchwork}. Two premier tools for creating interactive, connected plots with click events and tool-tips. (And they're super easy to use too.) #rstats #dataviz
3
61
349
@rappa753
Albert Rapp
1 year
This is one of the best dataviz books out there. To the point and full of dataviz wisdom: Storytelling with Data by Cole Nussbaumer Knaflic. I use the book's principles all the time and the book is short enough to finish it in a weekend.
7
56
340
@rappa753
Albert Rapp
3 years
Ever wanted to use colors in #ggplot2 more efficiently? Based on #dataviz principles described in a recent blog post from @lisacmuth , I'll show you how. Find my blog post at Stick around for a quick summary thread ๐Ÿงตโฌ‡๏ธ #rstats
6
50
330
@rappa753
Albert Rapp
2 years
Interactive plots let users focus on what matters to them. That's why they are a popular choice for data visualization. You can make any ggplot interactive in just a few easy steps. #rstats
6
60
335
@rappa753
Albert Rapp
1 year
{modelsummary} looks like a pretty slick package for reporting. Definitely keeping that one at the back of my mind ๐Ÿค” #rstats
Tweet media one
Tweet media two
7
41
334
@rappa753
Albert Rapp
1 year
Ever heard of logistic regression? Or Poisson regression? Both are generalized linear models (GLMs). They're versatile statistical models. And by now, they've probably been reframed as super hot #MachineLearning . Brush up on their math with this thread. #rstats
5
39
336
@rappa753
Albert Rapp
2 years
A really cool #rstats package is {ggchicklet}. Its geom_rrect() function let's you create rounded rectangles. That's how I've created this visualization. Code: Package:
Tweet media one
5
39
325
@rappa753
Albert Rapp
3 years
From standard output to powerful storytelling. Here's how you can recreate the storytelling with data look in #ggplot2 . A detailed thread ๐Ÿงตโฌ‡๏ธ #rstats #dataviz
Tweet media one
Tweet media two
4
56
311
@rappa753
Albert Rapp
2 years
Over the past year, I've shared hundreds of dataviz tricks. This thread compiles the best tricks and will help you to A) build clear visualizations B) choose better chart types C) use colors much more efficiently D) create a dynamic experience with interactive elements #rstats
5
42
318
@rappa753
Albert Rapp
1 year
Confession: I used to suck at #rstats . ๐Ÿ™ˆ But teaching a hands-on university course forced me to up my game. I read a ton of resources on stats/ML with R and compiled them into one book. And now you can use it too! Check out to level up your R skills.
Tweet media one
8
51
310
@rappa753
Albert Rapp
2 years
The best way to learn data analysis is to actually practice it. Each week, the #tidyTuesday challenge gives you plenty of opportunity for this. Don't know how to get started with the challenge? Here's an #rstats guide using this week's data.
5
41
295
@rappa753
Albert Rapp
2 years
I'm thinking about moving from RStudio to VSCode. #rstats folks: What are good resources to make the transition as smooth as possible? Any obstacles I should be aware of?
47
23
293
@rappa753
Albert Rapp
2 years
Paired bar charts suck at comparing values. The only reason they're used all the time is because they are easy to create. But there are better alternatives that are just as easy. Here's how to create 4 better alternatives with #rstats .
Tweet media one
7
47
301
@rappa753
Albert Rapp
2 years
Many people don't actually need a complex dashboard. An interactive document with a few toggles and sliders is easier to build and can give the same dynamic experience. With Quarto and Shiny you can do that in just a few steps. Here's how. #rstats
6
25
291
@rappa753
Albert Rapp
2 years
Repeating tasks with for-loops can get very ugly really fast. That's why I prefer to use functions instead of loops. The map() family from {purrr} gives you the perfect tools for that. You can learn to use them in 150 seconds in my newest video. (Link below) #rstats
Tweet media one
6
37
292
@rappa753
Albert Rapp
2 years
The newest version of {gt} lets you create interactive web tables ๐Ÿฅณ And it's super easy to manage. Everything is funneled through one function opt_interactive() ๐Ÿ‘Œ #rstats
Tweet media one
10
41
283
@rappa753
Albert Rapp
1 year
Paired bar charts suck at comparing values. The only reason they're used all the time is because they are easy to create. But there are better alternatives that are just as easy. Here's how to create 4 better alternatives with #rstats .
Tweet media one
2
43
289
@rappa753
Albert Rapp
2 years
Interactive reports with Quarto & Shiny are a game changer. Write all the important information into the text and let the reader check what you say using interactive elements. Great for teaching materials as well as for business reports. #rstats
Tweet media one
4
35
277
@rappa753
Albert Rapp
2 years
I built a table with this week's #tidyTuesday data and {gt}. Love the package. ๐Ÿฅณ Not to brag but I'm glad that I wrote an ebook about {gt}. I already forgot half of it and had to look it up ๐Ÿคฃ Code: Resource:
Tweet media one
6
31
286
@rappa753
Albert Rapp
1 year
Excel files are messy. So let me show you how to clean them with #rstats . It's just a matter of knowing the right functions. Once you know them, cleaning Excel files becomes much easier. In my newest YouTube video, I demonstrate how these powerful functions work (link below)
Tweet media one
5
46
283
@rappa753
Albert Rapp
2 years
I used to think tables are boring. But they can be beautiful & engaging. Here's a nice example from @infobeautiful . It uses many eye-catching elements. But you don't need catchy visuals to create a great table. Here are a couple of guidelines that will help you ๐Ÿงต
Tweet media one
5
38
277
@rappa753
Albert Rapp
2 years
As always, there's a #rstats package for every occasion. ๐Ÿ”€ With {ggbump}, bump charts (for rankings) are easily created. ๐Ÿ‘ท๐Ÿฝ With a little bit of work, one can transform them to ribbon bump charts. Here's a demo for this week's #tidyTuesday . Code:
Tweet media one
0
50
279
@rappa753
Albert Rapp
1 year
The #rstats ecosystem makes splitting a stacked bar plot simple. ๐Ÿฅณ This way, comparing groups is sooo much easier! ๐Ÿ‘Œ๐Ÿฝ โœ‚๏ธ Split stacked bars with facet_wrap() ๐Ÿชข Combine splits with totals via {patchwork} #dataviz
Tweet media one
6
39
277
@rappa753
Albert Rapp
2 years
Bump charts are great for visualizing rankings over time. Ribbon bump charts take that a step further. They also display a related quantity using the width of the ribbons. ๐Ÿคฏ Plus, they're beautiful and eye-catching. ๐Ÿ˜ #rstats Code:
Tweet media one
5
37
275
@rappa753
Albert Rapp
2 years
Frighteningly powerful #rstats combo: mutate() + across() + {tidyselect} helpers ๐Ÿ’ฅ ๐Ÿคฏ The syntax may be a bit confusing at first, though. So, here are a couple of simple examples. CODE:
Tweet media one
Tweet media two
Tweet media three
9
45
269
@rappa753
Albert Rapp
3 years
Last week, I held a short workshop teaching #RStats to Economics students without prior programming experience. Here are 6 lessons I learnt that I wish I had known in advance.
12
46
260
@rappa753
Albert Rapp
1 year
A lot of people create reports with tables in Word and PowerPoint. {flextable} let's you do all the number crunching in #rstats and then export it to Word and PowerPoint. Work in R. Communicate in MS Office. That way, everyone can use your work.
Tweet media one
Tweet media two
4
41
274
@rappa753
Albert Rapp
1 year
If there's one supremely useful function I can't live without anymore, it's clean_names() from {janitor}. Ain't nobody got time for using those pesky `` just to pick a badly named column. What's your function that you use every time? #rstats
Tweet media one
Tweet media two
14
28
269
@rappa753
Albert Rapp
1 year
Duplicate code sucks! Avoid copy-and-pasting your code and wrap it into a function instead. It's dead-simple with powerful tools like curly-curly and dot-dot-dot (works even for ggplot or dplyr code.) One of my most popular video teaches you how in 150 seconds (link below)
Tweet media one
5
39
272
@rappa753
Albert Rapp
1 year
ggplot creates superb visualizations ๐Ÿ’ฅ Here's a remake of an amazing viz from the PEW Research Center ๐Ÿฅณ Left: Remake Right: Original The maps were challenging but the {usmap} package helped A LOT! ๐Ÿ™ Video tutorial coming soon โœŒ๏ธ If you want, you can get notified below.
Tweet media one
Tweet media two
6
21
276
@rappa753
Albert Rapp
1 year
In my first #rstats class, students loved the dinosaur from the dataSaurus package. One student even asked for more dinosaurs in class, and I couldn't resist! ๐Ÿคช I searched for dinosaur images, extracted coordinates and started plotting. So, here are more ggplot dinosaurs ๐Ÿฆ•๐Ÿฆ–
Tweet media one
7
31
268
@rappa753
Albert Rapp
1 year
Frighteningly powerful #rstats combo: mutate() + across() + {tidyselect} helpers ๐Ÿ’ฅ ๐Ÿคฏ But the syntax may be a bit confusing at first. So, here are a couple of simple examples. (With editable code plus meme below)
Tweet media one
Tweet media two
Tweet media three
5
28
275
@rappa753
Albert Rapp
2 years
'Tis the season to be sharing R treats: The curly-curly operator is a great way to use a data set's column names in your own functions. #rstats
Tweet media one
8
36
261
@rappa753
Albert Rapp
3 years
I tried to explain the variance of the sample variance to my students. Not sure if I did well, so I build a small #Shiny app to let students explore that on their own. Find it at I am still amazed how an #rstats package allows me to create web apps.
Tweet media one
3
36
249
@rappa753
Albert Rapp
1 year
Two things every {ggplot2} course should teach: 1๏ธโƒฃ Use proper labels and create a title with labs() 2๏ธโƒฃ Increase the text size with theme_grey(base_size = ...) Just two lines of code. But a considerable amount of respect for your future audience (which has to read your graph).
Tweet media one
Tweet media two
Tweet media three
2
36
264
@rappa753
Albert Rapp
2 years
Data visualization doesn't have to be complicated. ๐Ÿคฏ In fact, ggplot makes it dead-simple to implement some of the most effective dataviz principles. Here are six dataviz principles that are so easy that any beginnerโ€™s course should teach them. #rstats
2
48
255
@rappa753
Albert Rapp
2 years
Cleaning Excel files in R is tedious! With the {janitor} package it gets much easier. It helps you to - remove empty cells - create clean column names - format Excel's weird date formats I show you how the package works in this demo video: #rstats
4
41
247
@rappa753
Albert Rapp
2 years
Sometimes people ask me if I can do one-on-one R tutoring. Sure I can. But then my hourly rate applies. And there are many amazing *free* resources. Want to try them first? Here are a few that I recommend. #rstats
8
42
252
@rappa753
Albert Rapp
2 years
I've been meaning to incorporate a bit of AI into my #rstats workflow. {gpttools} may just be the thing to help me get started. Left: Regular script Right: Automatically converted script to functions Check out this cool package from @JamesHWade at
Tweet media one
Tweet media two
5
39
241
@rappa753
Albert Rapp
2 years
By itself, a standard #ggplot2 output can rarely convince anyone. You need a story to communicate your message. And for effective storytelling, your plot has to be customized. My newest blog post shows you how. Find it at #rstats #dataviz ๐Ÿงต๐Ÿงตโฌ‡๏ธ
Tweet media one
4
29
235
@rappa753
Albert Rapp
2 years
Exporting ggplots without worrying about size issues? That's easy with the {camcorder} package! Call gg_record() when you start visualizing and ALL plots are exported. Nothing changes when you're finished. Check out this vid for a full breakdown: #rstats
Tweet media one
1
39
241
@rappa753
Albert Rapp
1 year
Using colors in your plot titles is a great way to โœ… remove the legend and โœ… give more room to your data. In ggplot, all it takes for this is learning one small trick. Tomorrow, my 3-minute newsletter will show you this trick. If you're curious, feel free to join us below.
Tweet media one
4
26
251
@rappa753
Albert Rapp
2 years
Analytics dashboards are a popular way to explore data or to communicate insights. So it's good to know how to build one. Here's how you do that with R in no time. ๐Ÿงต #rstats #shiny
Tweet media one
Tweet media two
7
35
241
@rappa753
Albert Rapp
1 year
Need to extract days, months, years or more from time data? Don't compute them all manually with {lubridate}. That's way too tedious. The {timetk} package has a nice function that does all the heavy lifting for you. LEFT: {lubridate} workflow RIGHT: {timetk} workflow #rstats
Tweet media one
Tweet media two
7
36
249
@rappa753
Albert Rapp
2 years
I am rebuilding my #rstats blog from the bottom up with #quarto . This will let me use quarto's cool new tricks like tabs and easy columns. I've already spent hours using quarto's great docs to build a custom blog. If you want to do the same, let me show you what I did.
Tweet media one
Tweet media two
5
33
231
@rappa753
Albert Rapp
2 years
Paired bar charts suck at comparing values. Still, they're used all the time because they are easy to make. But there are better alternatives that are just as easy. Here's how to create 4 alternatives with #rstats . ๐Ÿงต
4
35
236
@rappa753
Albert Rapp
2 years
This blog post () is truly a bridge between #python and #rstats . All tables are created in Python and R. A superb ressource for creating tables in both languages. Great work from @karbartolome .
Tweet media one
2
45
233
@rappa753
Albert Rapp
2 years
Dumbbell plots are great. But if your data compares times or dates, why not use arrows instead? This way, you can use colors differently. Left: dumbbells (color shows time) Right: arrows (color shows direction of change) #rstats Code:
Tweet media one
Tweet media two
5
27
236
@rappa753
Albert Rapp
2 years
Calculating multiple lags for time series is annoying. Here's an insanely powerful combo from @paul_elotro to make your life easier. It channels the full #rstats power with 1๏ธโƒฃ partial() + map() from {purrr} 2๏ธโƒฃ curly-curly {{ }} from {rlang} 3๏ธโƒฃ mutate() + across() from {dplyr}
Tweet media one
11
31
238
@rappa753
Albert Rapp
2 years
Many people insisted that {ggiraph} is a great package. So I gave it a try using this week's #tidyTuesday data. And it is indeed amazing. Makes it super easy to turn a ggplot interactive (like adding a tooltip). #rstats Code:
Tweet media one
Tweet media two
7
22
232
@rappa753
Albert Rapp
2 years
Tables can be suuuper boring. But they don't have to be. A well-crafted table can be an exciting tool for communicating data insights. Using practical tips and examples, my free {gt} book shows you how. Learn to create beautiful tables with #rstats at
Tweet media one
4
39
229
@rappa753
Albert Rapp
2 years
Your dataviz can easily drill down into what's important with conditional formatting. #rstats has a powerful combo to do that: 1๏ธโƒฃ case_when() or if_else() 2๏ธโƒฃ scale_*_identity() Here's a demo how you can change color, shapes or whatever based on any condition you like #dataviz
Tweet media one
Tweet media two
4
30
227
@rappa753
Albert Rapp
1 year
I used to struggle with emphasizing single words in a plot title. Then, I learned with about the {ggtext} package. Now it's pretty easy to just wrap words in **..** and make them bold that way.
Tweet media one
Tweet media two
8
41
234
@rappa753
Albert Rapp
2 years
Need to turn your ggplot interactive? Like for a dashboard? Just pass your plot to ggplotly() from {plotly}. Doesn't always return perfect matches but good for a quick conversion. You can always tweak your plot later on. #rstats
Tweet media one
Tweet media two
5
37
222
@rappa753
Albert Rapp
2 years
Today, I finished two new #rstats video tutorials ๐Ÿฅณโ˜บ๏ธ Hope these will serve you well ๐Ÿ“š๐Ÿค“ 1โƒฃ Extracting spatial data from OpenStreetMap 2โƒฃ How to build an interactive point-and-click game with {Shiny}
Tweet media one
Tweet media two
2
38
217
@rappa753
Albert Rapp
1 year
The newest version of {gt} lets you create interactive web tables ๐Ÿฅณ And it's super easy to manage. Everything is funneled through one function opt_interactive() ๐Ÿ‘Œ #rstats
Tweet media one
5
40
224
@rappa753
Albert Rapp
2 years
dot-dot-dot is my favorite advanced #rstats concept. It's the R world's "Let someone else deal with that". Basically, everything that is not explicitely defined in your function will be passed along to the next "...".
Tweet media one
7
21
220
@rappa753
Albert Rapp
1 year
Creating calendar plots with #rstats is surprisingly easy. ๐Ÿ“… Handling dates: {lubridate} and {stringi} (for week of month) ๐ŸŽจ Plotting: geom_tile() and facet_wrap() #dataviz
Tweet media one
1
25
218
@rappa753
Albert Rapp
1 year
Want to combine Quarto and Shiny? This follow-up blog post shows you how to combine these awesome technologies. Find it at #rstats
Tweet media one
Tweet media two
@rappa753
Albert Rapp
1 year
Setting up the UI in Shiny apps can take forever. If you only need a few interactive elements, just use a Quarto document. This way, you can add interactive elements quickly to your text without the hassle of layout and design. #rstats
Tweet media one
2
15
142
5
40
220
@rappa753
Albert Rapp
1 year
I've once struggled with using different fonts in ggplot. For some reason I found it super hard to set up fonts in Windows. But then I found the {showtext} package. Makes it dead-simple to use fonts in 2 steps: 1๏ธโƒฃ Load fonts from google 2๏ธโƒฃ Enable showtext rendering Done ๐Ÿฅณ
Tweet media one
Tweet media two
4
34
209