Alistair Beith
abeith.bsky.social
Alistair Beith
@abeith.bsky.social
Research Fellow in Hearing Sciences at University of Nottingham | Speech | Communication | #Rstats
The ifelse call isn’t modifying your tibble but you’re returning the tibble. I’d do:
if (<condition>) {
<modify tibble>
return(<your tibble>)
} else {
<modify tibble differently>
return(<your tibble>)
}
April 3, 2025 at 8:27 AM
Well-tempered would have been great for integration with (Ave) MariaDB.
January 21, 2025 at 8:18 AM
Day 23 #AdventOfCode #rstats

Sorry. Sometimes you just have to get the star.
December 23, 2024 at 11:34 AM
My brain didn’t manage that `!=` == xor but I spotted the powers of 2 early and didn’t want to fix the integer overflow issue.
December 22, 2024 at 8:36 PM
Day 22 #AdventOfCode #rstats

I feel like I could have lived without knowing that raw vectors in R are little-endian.
December 22, 2024 at 5:32 PM
Day 20 #AdventOfCode #rstats

Quite proud of this one.
December 20, 2024 at 6:22 PM
Day 19 #AdventOfCode #rstats

Fun way to learn that overlapping regex is hard in R.
December 20, 2024 at 6:22 PM
Skipping days 16-18 for now. I particularly disliked Day 16 and still don't know why my solution to part 2 didn't work.
December 20, 2024 at 6:22 PM
Day 15 #AdventOfCode #rstats

Too many lines of code for this one so I'm just sharing a video instead.
December 20, 2024 at 6:22 PM
It’s the fewest lines of code I’ve written for one of these in days.
December 20, 2024 at 6:03 PM
Day 14 #AdventOfCode #rstats

My favourite day so far!
December 14, 2024 at 10:27 AM
Reduce and purrr::reduce have been handy. I also used Vectorize today and feel like that deserves more love.
December 14, 2024 at 1:05 AM
I like that there are more lines parsing the input than solving the problem!
December 13, 2024 at 10:29 PM
Day 13 #AdventOfCode #rstats

I resisted the urge to use complex numbers for the coordinates in part 1 only to find out that was the solution to part 2!
December 13, 2024 at 10:09 PM
Day 12 #AdventOfCode #rstats

There was a beautiful base R solution that worked with the sample input, but I gave up and used a package.
December 13, 2024 at 10:09 PM
But… “every problem has a solution that completes in at most 15 seconds on ten-year-old hardware”. But I guess 15 seconds running parallel with C++ can be a long time on 1 thread in R.
December 11, 2024 at 8:27 PM
That feels like cheating! I think I got close to a fast solution with igraph.
December 11, 2024 at 8:20 PM
I had to abandon my first attempt because an exponential linear model said it’d take a few years. So I’ll take this victory for now!
December 11, 2024 at 8:15 PM
Day 11 #AdventOfCode #rstats

I shouldn't admit to this one. How long is a blink? Because the last blink in my loop was almost 14 seconds.
December 11, 2024 at 7:18 PM
Day 10 #AdventOfCode #rstats

First use of curly-curly.
December 10, 2024 at 10:36 AM
Day 9 (Part 2) #AdventOfCode #rstats
December 9, 2024 at 6:26 PM
Day 9 (Part 1) #AdventOfCode #rstats

In spite of the evidence I'm still convinced this is a run-length encoding problem!
December 9, 2024 at 6:26 PM
Day 8 #AdventOfCode #rstats

Finally caught up!
December 8, 2024 at 12:13 PM
Day 7 #AdventOfCode #rstats

Yes, the `%||%` operator is a relic of a failed eval(parse(text = x)) approach.
December 8, 2024 at 12:03 PM
Day 6 #AdventOfCode #rstats

Resorted to brute force and patience for part 2 in the end. Probably only a couple of conditionals away from being a not terrible solution!
December 8, 2024 at 11:55 AM