Måns Thulin's Avatar

Måns Thulin

@mansthulin.bsky.social

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

181 Followers  |  91 Following  |  105 Posts  |  Joined: 15.11.2024  |  2.3266

Latest posts by mansthulin.bsky.social on Bluesky

Yes! Right assignment with pipes *chef's kiss*

25.09.2025 06:28 — 👍 1    🔁 0    💬 0    📌 0

This is a great update! I really like how colour palettes are now part of themes and the ink and paper feature in themes.

11.09.2025 11:50 — 👍 1    🔁 0    💬 0    📌 0
Video thumbnail

{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/

19.08.2025 21:24 — 👍 146    🔁 40    💬 7    📌 1

#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.

15.08.2025 16:53 — 👍 84    🔁 24    💬 10    📌 5

Highly recommended! It solves the problems you're having and speeds up the installation of new packages.

14.08.2025 08:11 — 👍 2    🔁 0    💬 0    📌 0
Preview
GitHub - eddelbuettel/r2u: CRAN as Ubuntu Binaries CRAN as Ubuntu Binaries. Contribute to eddelbuettel/r2u development by creating an account on GitHub.

Have you tried R2U? github.com/eddelbuettel...

14.08.2025 07:15 — 👍 5    🔁 0    💬 2    📌 0
Post image

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

22.07.2025 12:22 — 👍 6    🔁 2    💬 0    📌 0
Modern Statistics with R Modern Statistics with R

I'm extremely biased, but I think Modern Statistics with R is a great choice 😁
www.modernstatisticswithr.com

04.07.2025 20:37 — 👍 7    🔁 2    💬 1    📌 0
Bootstrap inference made easy: p-values and confidence intervals in one line of code
YouTube video by R Consortium Bootstrap inference made easy: p-values and confidence intervals in one line of code

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

02.07.2025 06:47 — 👍 8    🔁 3    💬 0    📌 0

Very nice! I really like what this package has turned into. Now, if only it worked seamlessly with pipes... 😉

04.06.2025 09:09 — 👍 5    🔁 0    💬 0    📌 0

I prefer the term "overfitted regression models". Gives a different and perhaps more accurent ring to things:
- "Will overfitted regression models take our jobs?"
- "92 % of students use overfitted regression models in their studies."
- "Overfitted regression models in military decision making."

04.06.2025 09:07 — 👍 0    🔁 0    💬 0    📌 0

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...

03.06.2025 09:36 — 👍 11    🔁 4    💬 0    📌 0

#rstats base ?`$`

29.05.2025 10:58 — 👍 17    🔁 3    💬 3    📌 1
Preface | Computational Statistics with R Lecture notes providing an introduction to computational statistics using the R programming language.

@tiddlydump.bsky.social perhaps I have shared this before. It's an unfinished project but has some #rstats gems imho
cswr.nrhstat.org

27.05.2025 13:57 — 👍 7    🔁 2    💬 1    📌 0

Following this thread with great interest. I still haven't found an LLM that's even remotely useful for anything beyond the most trivial tasks (also when used with tools like {gander}). Too many hallucinated functions and ignored prompt instructions still.

27.05.2025 09:00 — 👍 1    🔁 0    💬 1    📌 0

I don't like var, as it's the name of a commonly used function. col is also a base R function. I'd go with x.

27.05.2025 06:16 — 👍 2    🔁 0    💬 0    📌 0

To be clear, I'm not saying that those are the actual priorities within the company. I'm just saying how things appear to users.

26.05.2025 20:50 — 👍 3    🔁 0    💬 0    📌 0

Agreed. But as a customer I see Posit pushing Python tools much more than R tools. Trying to break into the Python market I guess. Which makes sense, but it does give an impression that R isn't as important, and pushes R users towards Python rather than the other way around.

26.05.2025 20:46 — 👍 4    🔁 0    💬 1    📌 0

According to my system logs, the actually memory usage of the R session is 104 MB (plus 273 MB for RStudio). So this seems to be a bug in the memory usage report in RStudio.

26.05.2025 13:48 — 👍 5    🔁 0    💬 0    📌 0
Screenshot of RStudio, showing that the environment is empty but that 17.12 GiB of RAM is being used.

Screenshot of RStudio, showing that the environment is empty but that 17.12 GiB of RAM is being used.

This seems like an awfully high RAM usage for a new #Rstats session in RStudio. 🤔 Anyone seen this before?

26.05.2025 13:44 — 👍 15    🔁 2    💬 2    📌 0
Preview
Posit

Looking at @posit.co from the outside, it definitely seems like their focus has shifted from #Rstats to Python. Looking at the 9 posts on the front page of the Posit blog (posit.co/blog/), 4 posts are language agnostic and 5 are about Python. None are about R.

26.05.2025 13:28 — 👍 7    🔁 0    💬 1    📌 0

Positron is built on top of VSCode, so it's pretty much the same as that in VSCode. But it also has some features from RStudio, like a variables pane and a data explorer.

22.05.2025 13:52 — 👍 0    🔁 0    💬 1    📌 0

RStudio offers both multiple panels for different scripts and parallel R sessions (through the terminal). But I agree that the git integration in VSCode is much better. Have you checked Positron out?

22.05.2025 10:13 — 👍 2    🔁 0    💬 2    📌 0

Light mode is still the default in most browser and on most sites, so that's what I usually go with. An added bonus is that the same plot can be used for print without any modifications, unlike dark mode plots.

21.05.2025 17:36 — 👍 1    🔁 0    💬 1    📌 0
Creating a custom ggplot2 theme – Måns Thulin

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

21.05.2025 12:06 — 👍 7    🔁 1    💬 3    📌 0

And maybe with a description of what an RSS feed is? 😀

21.05.2025 08:20 — 👍 2    🔁 0    💬 1    📌 0
Creating a Blog – Quarto

As long as it's done politely, absolutely! Preferably with a link to the part of the Quarto documentation that describes how to add an RSS feed (quarto.org/docs/website...)

21.05.2025 08:17 — 👍 2    🔁 1    💬 1    📌 0

"Pro tip: logistic regression should by default use ridge regularisation with the shrinkage parameter set to 1. That's why you always should use Python's sklearn.linear_model.LogisticRegression instead of #Rstats silly non-regularised glm."

09.05.2025 13:22 — 👍 5    🔁 1    💬 0    📌 0
Post image

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.

09.05.2025 06:53 — 👍 29    🔁 6    💬 3    📌 1
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.

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.

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

29.04.2025 08:05 — 👍 15    🔁 4    💬 4    📌 1

@mansthulin is following 20 prominent accounts