Tim Tiefenbach Profile picture
Senior Data Scientist in insurance. Dr in economics. Here for #RStats 📊 & 🐍. Family 👨‍👩‍👧‍👦 guy who loves coffee ☕️ & tea 🫖 and 🇯🇵(@fosstodon)
May 1 4 tweets 1 min read
Recently I‘m working with #RStats quarto dashboards. My first impression is that they are pretty awesome. But I had some struggle with the following things (any advise appreciated!): (1) Setting a dynamic dashboard title like "week X".

In Rmarkdown this was easy, bc preprocessing was done with R and we could use `()`. I don’t see how this is possible in quarto.🤔Sys.Date
Nov 18, 2022 6 tweets 1 min read
#RStats Twitter: I need help naming a function❕

I've created a function `ping()` that, called on a purrr iterator function, runs the i-th element and returns `.f(x[[i]]).`. Now I’m working on a function that works similar, but instead of the output, it returns all input elements at i, e.g. .x[[i]] and, if present, .y[[i]]] etc.

I'm having trouble finding a good name. 😳

Any suggestions? 🤷
Oct 17, 2022 21 tweets 6 min read
I see still a lot of #RStats tweets about the base pipe vs. the {magrittr} pipe, often in favor of the former.

I have to admit: I still stick to the magrittr pipe and here is a Tweetorial on why.

🧵

%>% The logo of the magrittr package The {magrittr} pipe supports at least seven advanced features.

Some of them are quite useful and once used to them, they are hard to give up.

1. One feature, that comes in handy quite often, is that we can use the dot `.` as unnamed placeholder.

%>% # 🔥 unnamed placeholder c(1:3) %>%   paste("No."
Aug 21, 2022 17 tweets 4 min read
Following my thoughts on #RStats purrr-style lambda functions the other day here is a short tweetorial on the `.f` argument in purrr’s iterator functions (e.g. `map`, `walk` etc), which accepts functions in different forms.

🧵 We can supply either:

1. a named function as a bare function name
`map(mtcars, mean)`

2a. an anonymous function
`map(mtcars, function(x) mean(x))`

2b. or alternatively if R >= 4.1
`map(mtcars, \(x) mean(x))`

3. a purrr-style formula
`map(mtcars, ~ mean(.x))` # There are three different...
Jul 17, 2022 10 tweets 3 min read
I totally agree. Most of the time we don’t need #RStats to be fast, … until we do. There are at least three areas where speed is of the essence:

1.Big data sets
2.Simulations
3.Shiny Apps

A thread 🧵 Big data is a no brainer: up to a certain point, like one million rows, speed is not really an issue. But once we are dealing with several million rows, things might get slow depending on the framework / code base and the computer power.