Stack Overflow has slowed down since AI, but every so often I still come across a brilliant gem of an answer you can learn a lot from.
04.11.2025 07:34 β π 0 π 0 π¬ 0 π 0@zx8754.bsky.social
Analysis - Data - Analysis - Data - Volleyball - Father - #rstats #STEM #ProstateCancer
Stack Overflow has slowed down since AI, but every so often I still come across a brilliant gem of an answer you can learn a lot from.
04.11.2025 07:34 β π 0 π 0 π¬ 0 π 0listogram plot - Histogram of three-letter words, with the words themselves shown on the plot.
#rstats plot of the day - "Listogram" by r2evans
stackoverflow.com/a/79808261/6...
quote from the linked post: "my default assumption is nothing is going to work" https://blog.genesmindsmachines.com/p/we-still-cant-predict-much-of-anything
"my default assumption is nothing is going to work" - @clauswilke.com
23.10.2025 14:04 β π 0 π 0 π¬ 0 π 0"if" only handles scalars, "ifelse" handles vectors. If condition is longer than 1, comparing them doesn't make sense, right?
23.10.2025 10:50 β π 2 π 0 π¬ 1 π 0as.integer(condition)
23.10.2025 10:30 β π 2 π 0 π¬ 1 π 0set.seed((\(x) sum(x %% 10) + length(x))(as.integer(charToRaw("Forty-two"))))
#rstats
Men with BRCA1 and BRCA2 mutations should get annual #ProstateCancer screening.
The IMPACT trial finds BRCA1 carriers are 3 times more likely to have aggressive prostate cancers than non-carriers.
Results from the international trial shared at @myesmo.bsky.social
www.icr.ac.uk/about-us/icr...
#rstats easier to compare the ratios
08.10.2025 10:15 β π 1 π 0 π¬ 0 π 0It had been gradually declining by about 5 million before the war, then dropped by another 5 million between 2022 and 2025.
08.10.2025 09:22 β π 2 π 1 π¬ 0 π 0Looks like it is real - www.adsoftheworld.com/campaigns/st...
I understand the awareness function, but I'd rather see humped crossings or traffic calming measures before the crossings. The issue isn't visibility, it's the driving culture of ignoring them that needs to change.
one day I will never master these
08.09.2025 06:50 β π 1 π 0 π¬ 0 π 0"Hence, in the R Core meetings in Toulouse in 2019, it was decided to move towards using stringsAsFactors = FALSE by default, ideally starting with the 4.0.0 release."
Blame these guys π€ͺ
blog.r-project.org/2020/02/16/s...
Screenshot of the answer at: https://unix.stackexchange.com/a/153662/16560
Ah, thought it was a hidden joke from devs, but it isn't
unix.stackexchange.com/a/153662/16560
I use Google as calculator, too. But recently discovered that the iPhone Notes app does the same:
04.09.2025 20:08 β π 0 π 0 π¬ 1 π 0Create a data.table row-wise Aliases: rowwiseDT Keywords: ### ** Examples rowwiseDT( A=,B=, C=, 1, "a",2:3, 2, "b",list(5) ) A B C <num> <char> <list> 1: 1 a 2,3 2: 2 b 5
You can define a tibble row-by-row with tribble(): tribble( ~x, ~y, ~z, "a", 2, 3.6, "b", 1, 8.5 ) #> # A tibble: 2 Γ 3 #> x y z #> <chr> <dbl> <dbl> #> 1 a 2 3.6 #> 2 b 1 8.5
#rstats #TIL I knew about tibble::tribble, but just discovered data.table::rowwiseDT.
"creates a data.table object by specifying a row-by-row layout. This is convenient and highly readable for small tables."
Itβs from ggfun: cran.r-project.org/package=ggfun
02.09.2025 04:06 β π 0 π 0 π¬ 0 π 0Looks like it is from ggfun package. Thanks for looking into this.
cran.r-project.org/package=ggfun
update: Searching GitHub R repos gives 1.5K hits. Looking at couple of pages, it looks like it is from ggfun - cran.r-project.org/web/packages...
01.09.2025 13:30 β π 0 π 0 π¬ 0 π 0Yes, checked the magrittr, too, nothing.
01.09.2025 13:27 β π 0 π 0 π¬ 0 π 0I'm afraid thereβs no context, it comes from another user in a private group chat. I've asked for clarification and will provide an update once they respond with more info.
01.09.2025 09:22 β π 1 π 0 π¬ 1 π 0#rstats pipe help, where is this from? I am guessing it is "modify and re-assign".
%<+%
Google didn't help, Gemini says it is invalid R code or it is a regex. ChatGPT says it is from ggplot, searching GitHub didn't help. But found this function ggplot2::`%+replace%`(), are they related?
They like to keep us floored.
18.08.2025 12:15 β π 2 π 0 π¬ 0 π 0ggpairs for first 4 PCs would be interesting to see.
24.07.2025 09:12 β π 1 π 0 π¬ 2 π 0# for loop f <- function(x, y){ out <- vector("integer", length(x)) yy <- y for(i in seq_along(x)) { mm <- match(x[ i ], yy) out[ i ] <- mm yy[ mm ] <- NA } out } # recursive version fr <- function(x, y, out = integer(length(x)), i = 1) { if (i > length(x)) return(out) mm <- match(x[ i ], y) out[ i ] <- mm if (!is.na(mm)) y[ mm ] <- NA fr(x, y, out, i + 1) } f(c("a", "b", "a"), c("a", "b", "c", "a")) # [1] 1 2 4 fr(c("a", "b", "a"), c("a", "b", "c", "a")) # [1] 1 2 4
24.07.2025 09:00 β π 0 π 0 π¬ 0 π 0Smells like recursive.
24.07.2025 08:18 β π 1 π 0 π¬ 1 π 0Challenge: check if you wish but do no reply to any work emails.
24.07.2025 07:40 β π 1 π 0 π¬ 0 π 0paletteer_c("grDevices::Earth", 30) https://r-charts.com/color-palettes/
I think they are called Earthy colours
24.07.2025 07:34 β π 1 π 0 π¬ 0 π 0Image source: https://blogs.sas.com/content/sastraining/2019/01/24/re-creating-a-hans-rosling-graph-animation-with-sas/ Hans Rosling bubble chart presentation TED Talks: The best stats you've ever seen | Hans Rosling https://www.youtube.com/watch?v=hVimVzgtD6w
22.07.2025 08:50 β π 10 π 2 π¬ 0 π 0library(dplyr) df1 |> mutate(mycol1 = "too") |> mutate(mycol2 = "much") |> mutate(mycol3 = "typing") df1 |> mutate(mycol1 = "this", mycol2 = "is", mycol3 = "less")
Similarly, long long time ago, I realised mutate can be called just once π€¦ββοΈ
21.07.2025 07:43 β π 1 π 0 π¬ 0 π 0As base::rbind also takes more than two dataframes as input, I expected at least the same from dplyr::bind_rows. And bind_rows handles rownames, factor levels, and mismatched column names better. #rstats
21.07.2025 07:37 β π 3 π 0 π¬ 0 π 0