Sign in

Måns Thulin

@mansthulin.bsky.social
276 followers 105 following 155 posts

I work in statistics and AI. Consultant, teacher, researcher. #Rstats user. Book: modernstatisticswithr.com Homepage: mansthulin.se Co-founder of aireview.se

PostsRepliesMedia
Måns Thulin @mansthulin.bsky.social · 10/09/2026
It's been six months since I wrote about some statistical friction points in {tidymodels} (bootstrap inference and LOOCV). I opened GitHub issues to track them back then, but none have received engagement or comments from the tidymodels team yet. Would still love to see a dialogue on these. #Rstats
040
Måns Thulin @mansthulin.bsky.social · 15/06/2026
The native pipe has finally become the default in new RStudio installs! 🥳 #Rstats github.com/rstudio/rstu...
github.com
Use native pipe (`|>`) instead of magrittr pipe (`%>%`) by default? · Issue #14965 · rstudio/rstudio
Native pipe was introduced in R 4.1, which was released in 2021. I understand it was too early to switch the default at the time of the native pipe support was added in RStudio, but maybe it's rath...
0141
Reposted by Måns Thulin
Dr Di Cook @visnut.bsky.social · 11/05/2026
Super excited to get this at my door today! Ursula Laa and my book on exploring high-d data and models is in print! Book website is www.routledge.com/Interactivel... if interested I think my 30% discount code might work for you - msg me. Time to update dicook.github.io/mulgar_book/ too! #rstats
415832
Reposted by Måns Thulin
James Balamuta @coatless.bsky.social · 04/05/2026
A month later, here is what happened to this work. blog.thecoatlessprofessor.com/posts/extrac... #rstats
blog.thecoatlessprofessor.com
Extraction with a Footnote – TheCoatlessProfessor
2249
Måns Thulin @mansthulin.bsky.social · 26/02/2026
While we're discussing what we like and dislike in #Rstats, here's why I don't like tidymodels: mansthulin.se/posts/tidymo...
mansthulin.se
Why I don’t use {tidymodels} – Måns Thulin
7427
Reposted by Måns Thulin
Dirk Eddelbuettel @eddelbuettel.com · 25/02/2026
Josh Goldstein emailed me a nice tip for @rdatatable.bsky.social chaining: if we start a chained `data.table` operation inside a set of parens, we are no longer subject to the 'REPL constraint' and can keep each operation on a line. See ALT text. #rstats Now in the pdf at github.com/eddelbuettel...
Diff of a change the 'Getting Started in R - Tinyverse Edition' manuscript with a nice data.table improvement: inside a pair of ( ) we can place each chained operation on its own line improving readability.  

I.e. we have

cw21 <- (  # use '(' to keep ops on separate lines
    cw[Time %in% c(0,21)]          # i: select rows
    [, weight := Weight]           # j: mutate
    [, Group := factor(Group)]
    [, .(Chick,Group,Time,weight)] # j: arrange
    [order(Chick,Time)]            # i: order
    [1:5]                          # i: subset
)
2234
Reposted by Måns Thulin
R Consortium @rconsortium.bsky.social · 24/02/2026
R/Medicine CFP is open 🩺🧪 Deadline: March 6 - still time! Submit: Talks, Lightning Talks, Demos, Workshops - Using R + Shiny for health, lab, clinical data First-time speaker? Email for feedback: rmedicine.conference@gmail.com rconsortium.github.io/RMedicine_we... #rstats #datascience
R Medicine 2026 - main graphic - Call for Proposal, deadline March 6
184
Måns Thulin @mansthulin.bsky.social · 23/02/2026
I love RStudio, but I'm flabbergasted by the fact that @posit.co still haven't made |> the default for the Ctrl+Shift+C keyboard shortcut, despite their using it in e.g. the tidyverse documentation and R4DS. #Rstats
181
Måns Thulin @mansthulin.bsky.social · 13/02/2026
I've been playing around with {marginaleffects} in some projects lately, and I really like it. Lots of useful stuff in there! If you work with regression models and haven't checked it out already, I strongly recommend that you do so: marginaleffects.com/bonus/get_st... #Rstats #Databs
marginaleffects.com
Quick start – Model to Meaning
1150
Reposted by Måns Thulin
Andrew Heiss @andrew.heiss.phd · 09/12/2025
Some closing thoughts for my students this semester on LLMs and learning #rstats datavizf25.classes.andrewheiss.com/news/2025-12...
Will you incorporate LLMs and AI prompting into the course in the future?
No.

Why won’t you incorporate LLMs and AI prompting into the course?
These tools are useful for coding (see this for my personal take on this).

However, they’re only useful if you know what you’re doing first. If you skip the learning-the-process-of-writing-code step and just copy/paste output from ChatGPT, you will not learn. You cannot learn. You cannot improve. You will not understand the code.In that post, it warns that you cannot use it as a beginner:

…to use Databot effectively and safely, you still need the skills of a data scientist: background and domain knowledge, data analysis expertise, and coding ability.

There is no LLM-based shortcut to those skills. You cannot LLM your way into domain knowledge, data analysis expertise, or coding ability.

The only way to gain domain knowledge, data analysis expertise, and coding ability is to struggle. To get errors. To google those errors. To look over the documentation. To copy/paste your own code and adapt it for different purposes. To explore messy datasets. To struggle to clean those datasets. To spend an hour looking for a missing comma.

This isn’t a form of programming hazing, like “I had to walk to school uphill both ways in the snow and now you must too.” It’s the actual process of learning and growing and developing and improving. You’ve gotta struggle.This Tumblr post puts it well (it’s about art specifically, but it applies to coding and data analysis too):

Contrary to popular belief the biggest beginner’s roadblock to art isn’t even technical skill it’s frustration tolerance, especially in the age of social media. It hurts and the frustration is endless but you must build the frustration tolerance equivalent to a roach’s capacity to survive a nuclear explosion. That’s how you build on the technical skill. Throw that “won’t even start because I’m afraid it won’t be perfect” shit out the window. Just do it. Just start. Good luck. (The original post has disappeared, but here’s a reblog.)

It’s hard, but struggling is the only way to learn anything.You might not enjoy code as much as Williams does (or I do), but there’s still value in maintaining codings skills as you improve and learn more. You don’t want your skills to atrophy.

As I discuss here, when I do use LLMs for coding-related tasks, I purposely throw as much friction into the process as possible:

To avoid falling into over-reliance on LLM-assisted code help, I add as much friction into my workflow as possible. I only use GitHub Copilot and Claude in the browser, not through the chat sidebar in Positron or Visual Studio Code. I treat the code it generates like random answers from StackOverflow or blog posts and generally rewrite it completely. I disable the inline LLM-based auto complete in text editors. For routine tasks like generating {roxygen2} documentation scaffolding for functions, I use the {chores} package, which requires a bunch of pointing and clicking to use.

Even though I use Positron, I purposely do not use either Positron Assistant or Databot. I have them disabled.

So in the end, for pedagogical reasons, I don’t foresee me incorporating LLMs into this class. I’m pedagogically opposed to it. I’m facing all sorts of external pressure to do it, but I’m resisting.

You’ve got to learn first.
14336103
Måns Thulin @mansthulin.bsky.social · 09/12/2025
This is so useful. I usually add custom information to the box shown when hovering, using the text geom. An example can be found here: www.modernstatisticswithr.com/eda.html#det... #Rstats #statsky #databs
modernstatisticswithr.com
4 Exploratory data analysis and unsupervised learning | Modern Statistics with R
4 Exploratory data analysis and unsupervised learning | Modern Statistics with R
051
Reposted by Måns Thulin
Nicola Rennie @nrennie.bsky.social · 26/11/2025
One of the things that has been on my to do list for a very long time, is building a gallery of all of the charts I've made across #TidyTuesday, #30DayChartChallenge, #30DayMapChallenge, and other miscellaneous projects 📊 And it's finally here! Link: nrennie.rbind.io/viz-gallery/ #DataViz #RStats
nrennie.rbind.io
Data Visualisation Gallery
Gallery of data visualisations created by Nicola Rennie.
612821
Reposted by Måns Thulin
Daniel Gutierrez @ddgutierrez.bsky.social · 20/11/2025
Students often ask: “Is this model good enough?” My reply: “For what?” AUC, precision, F1—none of them matter unless you know what decision you're informing. Always tie metrics to action. #DataScience #MachineLearning #AI #RStats
072
Reposted by Måns Thulin
Claus Wilke @clauswilke.com · 22/10/2025
We need to have a conversation about random seeds. Don't use 42. blog.genesmindsmachines.com/p/if-your-ra...
blog.genesmindsmachines.com
If your random seed is 42 I will come to your office and set your computer on fire🔥
Figuratively. More likely you'll get a stern talking to.
168935
Måns Thulin @mansthulin.bsky.social · 13/10/2025
Chernoff faces for penguins. 🐧 This made my day.
010
Måns Thulin @mansthulin.bsky.social · 09/10/2025
A short tutorial on how to create gt cross-tables in one line of code using the #Rstats package ivo.table: mansthulin.se/posts/ivotab...
051
Måns Thulin @mansthulin.bsky.social · 09/10/2025
Happy to hear this. Positron certainly has its merits, but I think RStudio is a much better choice for the quiet majority who use #Rstats for statistical analyses rather than software engineering.
070
Måns Thulin @mansthulin.bsky.social · 11/09/2025
This is a great update! I really like how colour palettes are now part of themes and the ink and paper feature in themes.
010
Reposted by Måns Thulin
Vincent Arel-Bundock @vincentab.bsky.social · 19/08/2025
{tinytable} 0.13.0 for #RStats can now draw interactive tables with sorting, filtering & pages! And the 📦 is still an ultra-simple, powerful, and 0-dep way to create beautiful tables in basically any format: tex, typ, docx, pdf, png, md, etc Gallery & Docs: vincentarelbundock.github.io/tinytable/
614338
Reposted by Måns Thulin
Norm Matloff (你有冇諗清楚呀?) @matloff.bsky.social · 15/08/2025
#rstats #statistics I've released my new open source book, "Powered by Linear Algebra: the role of matrices and vector space in data science," at matloff.github.io/WackyLinearA.... Turns the classic LA course on its head! Still proves the theorems, but with a deep emphasis on applications.
matloff.github.io
88423
Reposted by Måns Thulin
Jonathan Kitt @jonathankitt.bsky.social · 22/07/2025
Wow ... I'd never come across this use of with(), which allows combining the pipe and computing a correlation coefficient. Thanks to @mansthulin.bsky.social for explaining this in his fantastic book www.modernstatisticswithr.com! #Rstats #code #neverknew
051
Måns Thulin @mansthulin.bsky.social · 02/07/2025
I really enjoyed attending and speaking at R/Medicine this year! I learned a lot. Huge thanks to the organisers! My talk "Bootstrap inference made easy" is now available online: www.youtube.com/watch?v=EeAt... #Rstats #Statsky
youtube.com
Bootstrap inference made easy: p-values and confidence intervals in one line of code
YouTube video by R Consortium
072
Reposted by Måns Thulin
Peter Dalgaard @pdalgd.bsky.social · 03/06/2025
For the #rstats nerds: 405 is "Method not allowed". That is why R 4.0.5 was nicknamed "Shake and Throw", due to this piece of dubious pedagogy: www.gocomics.com/peanuts/1978...
gocomics.com
Peanuts by Charles Schulz for July 30, 1978 | GoComics
Read Peanuts—a comic strip by creator Charles Schulz—for today, July 30, 1978, and check out other great comics, too!
0103
Reposted by Måns Thulin
zx8754 @zx8754.bsky.social · 29/05/2025
#rstats base ?`$`
library(dplyr)
library(purrr)
library(bench)

set.seed(42)

create_df <- function(rows, cols) {
  out <- replicate(cols, runif(rows, 1, 100), simplify = FALSE)
  out <- setNames(out, rep_len(letters, cols))
  as.data.frame(out) }

results <- press(
  rows = c(1000, 10000, 100000),
  cols = c(100,  1000,  10000),
  {
    d <- create_df(rows, cols)
    mark(
      d$f,
      d %>% .$f,
      d %>% pull(f),
      d %>% pluck("f"),
      min_iterations = 100
      )
    }
  )

ggplot2::autoplot(results)
bench::mark output plot
3162
Måns Thulin @mansthulin.bsky.social · 26/05/2025
This seems like an awfully high RAM usage for a new #Rstats session in RStudio. 🤔 Anyone seen this before?
Screenshot of RStudio, showing that the environment is empty but that 17.12 GiB of RAM is being used.
2141
Måns Thulin @mansthulin.bsky.social · 21/05/2025
The most common question I get when teaching ggplot2: "Can we change the background colour?" Yes, we can - and much more. Here's how to create your own ggplot2 themes: 🔗 mansthulin.se/posts/ggplot... #Rstats #datasky
mansthulin.se
Creating a custom ggplot2 theme – Måns Thulin
050
Måns Thulin @mansthulin.bsky.social · 09/05/2025
The new release of RStudio prints errors, warnings and messages in different colours. That's a great improvement! I teach introductory #Rstats a lot, and students *always* think messages are errors. Hopefully this will help.
3285
Reposted by Måns Thulin
Nicola Rennie @nrennie.bsky.social · 29/04/2025
For the prompt of "Extraterrestrial" on Day29 of the #30DayChartChallenge, I decided to make a chart designed in the style of an extraterrestrial who has never heard of good data visualisation principles! 📊 How many chart crimes can you spot? 🕵️‍♂️ #DataViz #RStats #ggplot2 #Day29
A deliberately chaotic and cluttered chart mocking bad data visualisation practices, featuring overlapping symbols, unreadable labels, clashing colours, and dual y-axes. The design satirises poor visual clarity and overcomplication.
4143
Måns Thulin @mansthulin.bsky.social · 16/04/2025
I created the {boot.pval} #Rstats 📦 aiming to make it easier to run bootstrap tests in R. Here's an example showing how you can use it to implement a correlation test using the bootstrap: mansthulin.se/posts/custom...
mansthulin.se
Running bootstrap tests using {boot.pval} – Måns Thulin
031
Reposted by Måns Thulin
Vincent Arel-Bundock @vincentab.bsky.social · 10/04/2025
📚😅🎉 Yay!! I just submitted the complete manuscript of my upcoming book to the publisher! Learn to easily and clearly interpret (almost) any stats model w/ R or Python. Simple ideas, consistent workflow, powerful tools, detailed case studies. Read it for free @ marginaleffects.com #RStats #PyData
Model to Meaning: How to interpret statistical models with marginaleffects for R and Python
21596148
Måns Thulin @mansthulin.bsky.social · 09/04/2025
A bit of a treasure trove this!
052
Måns Thulin @mansthulin.bsky.social · 09/04/2025
Base R can do what filter(), select(), and mutate() do — no tidyverse needed. Check out some side-by-side examples in my latest blog post: 🧑‍💻 mansthulin.se/posts/baseti... #Rstats
airquality |>
    transform(TempC = (Temp-32)/1.8,
              Month = month.name[Month]) |>
    aggregate(TempC ~ Month, mean)
2191
Reposted by Måns Thulin
Dr Di Cook @visnut.bsky.social · 26/03/2025
Somewhere in Berlin, fitting in with the atmosphere, there is now a little R hexsticker graffiti #rstats #DAGStat_2025
0262
Reposted by Måns Thulin
Solomon Kurz @solomonkurz.bsky.social · 19/03/2025
Who has an academic website they’re proud of? I’m especially interested in websites by grad students, and in websites built with Quarto. I’ll be offering a local workshop on building a website with Quarto, and I’m keen to give my audience examples. #rstats
4210118
Måns Thulin @mansthulin.bsky.social · 17/03/2025
This seems pretty useful! Any recommendations for LLMs than run locally that I can use when I try it out? (I have a GeForce RTX 4080 GPU with 16 GB RAM and 9728 CUDA cores) #Rstats
120
Måns Thulin @mansthulin.bsky.social · 05/03/2025
Interpreting residual plots can be tricky - how strong must patterns be to indicate model assumption violations? The latest #Rstats 📦 nullabor update makes this easier with lineup plots! 🔍 📈 Learn more: mansthulin.se/posts/nullab...
1213
Reposted by Måns Thulin
Nicola Rennie @nrennie.bsky.social · 03/03/2025
I've started collecting together some of my examples of data-driven art 📊 (with accompanying code) into a gallery 🎨 (Blog post coming soon about what I think data art is and why it's useful, alongside a tutorial-style example!) #RStats #Python #GenerativeArt #Rtistry #DataViz
screenshot of the data art gallery website showing a grid of data art examples, including bob ross painting colours, and orca sightings.
28313
Måns Thulin @mansthulin.bsky.social · 19/02/2025
Thanks for the kind words Martin! Anyone interested can find the open access book at modernstatisticswithr.com and/or get physical copies where books are sold (the second edition, published by Chapman & Hall last year, has a different cover than the first edition seen in the image).
modernstatisticswithr.com
Modern Statistics with R
Modern Statistics with R
03613
Måns Thulin @mansthulin.bsky.social · 05/02/2025
I played around a bit with the tidyplots #Rstats 📦, using it to visualise my 2024 reading habits. I quite liked it! Definitely makes creating certain types of plots easier. Give it a go if you haven't already. Blog post: mansthulin.se/posts/tidyre...
061
Måns Thulin @mansthulin.bsky.social · 27/01/2025
Has anyone exported path diagrams from #Rstats factor analysis models to Mermaid? I played around with this a little today but wasn't too pleased with the results: mansthulin.se/posts/mermai... #statsky #Quarto
030
Reposted by Måns Thulin
Christian Düben @cdueben.bsky.social · 27/01/2025
I am looking for contributors for my conleyreg #Rstats package. I keep getting feature requests, but am not going to do anything beyond basic maintenance myself. This is a great opportunity for aspiring R package #developers. The following issue outlines some details: github.com/cdueben/conl...
github.com
Further Development · Issue #5 · cdueben/conleyreg
conleyreg is my first R package. I developed it years ago within the scope of a paper revision. As far as I know, it remains many researchers' default choice for estimating Conley standard errors. ...
031
Reposted by Måns Thulin
James Balamuta @coatless.bsky.social · 23/01/2025
Interesting new #rstats package out by @t-kalinowski.bsky.social on automatically transpiling R code into Fortran for a nice speed pick up. github.com/t-kalinowski... Reminds me of {armacmp} attempt by Dirk Schumacher allowing for R to be converted into C++ using Armadillo matrix library.
github.com
GitHub - t-kalinowski/quickr: R to Fortran Transpiler
R to Fortran Transpiler. Contribute to t-kalinowski/quickr development by creating an account on GitHub.
1154
Måns Thulin @mansthulin.bsky.social · 21/01/2025
A new version of #Rstats 📦 {ivo.table} is now on CRAN! Use it to create publication-ready frequency tables in a single line of code: data |> select(variable1, variable2, variable3) |> ivo_table() 📖 Check out the short tutorial at mansthulin.se/posts/ivotab...
132
Måns Thulin @mansthulin.bsky.social · 16/01/2025
When your #Rstats package quite literally has reverse dependencies
010
Måns Thulin @mansthulin.bsky.social · 16/01/2025
New version of #Rstats 📦 {boot.pval} on CRAN: 🧮 Compute bootstrap p-values for regression coefficients with a single line of code. 🚫 Now works also when there's missing data (unlike car::Boot). 📊 Improved presentation of low p-values. Have a look at the vignette: cran.r-project.org/web/packages...
boot.pval hex
0111
Måns Thulin @mansthulin.bsky.social · 15/01/2025
Having played around with TabPFN a bit more, what impresses me the most is how fast it is compared to e.g. XGBoost. Still trying to figure out what its limitations are, but sure seems like a game changer for anyone doing supervised learning.
140
Måns Thulin @mansthulin.bsky.social · 10/01/2025
TabPFN, published two days ago in Nature, looks like it may be the new state-of-the-art for machine learning models. It's not available in #RStats yet, but I wrote a short tutorial about how you can run it using the reticulate package: mansthulin.se/tabpfn/
mansthulin.se
Fitting TabPFN models in R using reticulate
161
Måns Thulin @mansthulin.bsky.social · 12/12/2024
Adding this to my .Rprofile so that a stats quote is printed every time I start RStudio! #Rstats
182