Sign in

Jem Arnold

@jemarnold.bsky.social
667 followers 383 following 464 posts

PhD candidate & physiotherapist | 🩸Iliac artery endofibrosis / FLIA | Endurance testing & NIRS. Treat declarative statements as questions?

PostsRepliesMedia
Jem Arnold @jemarnold.bsky.social · 26/08/2026
Muscle oxidative capacity analysis with #mnirs is monoexponential by consensus. But are there secondary drift kinetics hiding in the data and biasing results?🤔 No idea, but could 'slow-component' drift be related to hyperaemia + metabolic rate adjustments as seen here? Thoughts? #rstats
Two-panel figure showing near-infrered spectroscopy slopes collected during repeated occlusions for evaluation of muscle oxidative capacity, modelled as an exponential decay in deoxygenation rates (slopes) over time. Title: mNIRS OxCap Kinetics Analysis. Subplot titles: Monoexponential and Exponential-linear drift models. y-axis: HHb slope (μM/sec). x-axis: Occlusion Times (mm:ss) (time range 0-04:00). monoexp coefs: Trial 1 tau=19.3 sec, k=3.1 /min. Trial 2 tau=15.4 sec, k=3.9 /min. exp-linear drift coefs: Trial 1 tau=24.6 sec k=2.4 min⁻¹ texc=73.7 sec slope=0.0526 /min. Trial 2 tau=19.0 sec k=3.2 min⁻¹ texc=57.1 sec slope=0.0445 /min
131
Reposted by Jem Arnold
Philip Skotzke @philipskotzke.bsky.social · 26/08/2026
New study out on muscle oxygen saturation (SmO₂) breakpoints using NIRS 🎉 First authored by @igfjarillo.bsky.social - I contributed via the statistical analyses. While we present the findings elsewhere, here I focus on what’s new about our approach and why it matters ⬇️🧵 1/8
Photo of the title and author section of the recently published study titled "Visually identified breakpoints in muscle oxygen saturation are not equivalent to ventilatory thresholds in national-level triathletes
133
Reposted by Jem Arnold
Ben Zipperer @benzipperer.org · 25/08/2026
relatedly, you may be interested in my absolute favorite, most-used R package, for inspecting the middle of a piped chain in interactive development
milesmcbain.r-universe.dev
breakerofchains: Break Chained Expressions and Run Them with Printed Output
Run an infix operator expression chain up to the line your cursor is on, printing the output, and ignoring any result assignment step. This facilitates easier interactive debugging of chained code. Co...
121
Jem Arnold @jemarnold.bsky.social · 25/08/2026
TIL you can print() intermediate objects in the middle of an #rstats pipeline🤯 ``` df |> print() |> process() |> print() |> plot() ``` Just added `return(invisible(x))` to my own print.generics. Very helpful to print a formatted results table and plot at the same time!
A screenshot from a Quarto document with code snippet:
```
df |>
    analyse_kinetics(
        method = "monoexponential",
        use_TD = FALSE,
        group_intervals = list(trial1 = 1:16, trial2 = 17:32),
        zero_time = TRUE
    ) |>
    print() |> # 😀
    plot()
```

Prints a formatted table of model result coefficients for the two specified "trials", and a plot with two facets showing observed data and modelled monoexponential curves
2162
Reposted by Jem Arnold
Solomon Kurz @solomonkurz.bsky.social · 13/08/2026
But on the upside, the only way I was able to zero in on the mistakes was because the authors shared code. Without that, I would have just been surprised and confused. Share your code! It makes the world a better place.
1264
Jem Arnold @jemarnold.bsky.social · 06/08/2026
{mnirs} R package for reading, processing, analysing muscle near-infrared spectroscopy data🦵🔦 updated to 0.7.0 Mostly internal performance improvements getting ready for `mnirs::analyse_kinetics()` soon! github.com/jemarnold/mn... Here are the key changes: 1/5🧵🔗👇 #rstats #nirs #muscleoxygenation
R package {mnirs} hex logo from https://github.com/jemarnold/mnirs
140
Jem Arnold @jemarnold.bsky.social · 25/07/2026
Another call for input! 📢 CLINICIANS, COACHES, and ATHLETES managing recovery from surgery for flow limitations in the iliac artery FLIA / endofibrosis We'd love to hear your experiences to help improve care for athletes. Please contact email below 👇 #cycling #sportsmedicine #sportmedicine
HAVE YOU HAD SURGERY FOR FLOW LIMITATIONS IN THE ILIAC ARTERY?

HELP IMPROVE FUTURE CARE FOR ATHLETES

We want to hear from you for an international research study

WHO CAN PARTICIPATE

You can participate if you:

are 18 years or older
have had surgery for flow limitations in the iliac artery (FLIA/endofibrosis)
can complete an English questionnaire

WHAT DOES PARTICIPATION INVOLVE

Online questionnaire
Approximately 15–20 minutes
Completely voluntary

JOIN THE STUDY

contact email: flia@mmc.nl

PLEASE SHARE

Do you know other athletes who have had iliac artery surgery?

Please send them this study information

STUDY INFORMATION

The study is conducted by the INSITE group:
International Study group for Identification and Treatment of Endofibrosis

Questions: flia@mmc.nl
162
Jem Arnold @jemarnold.bsky.social · 18/07/2026
#rstats how are we finding GPT-5.6 vs Fable/Opus for working in R? I don't like the R code it's been giving me so far, but I've spent more time with Claude so maybe I just need to set up better instructions? 🤔
130
Jem Arnold @jemarnold.bsky.social · 03/07/2026
In my brief experience so far, most likely a reversion to Opus 😅 #rstats
Screenshot of warning message from Anthropic Fable during routine R coding assistance: "Fable 5's safeguards flagged this message. The safeguards are intentionally broad right now and may flag safe and routine coding, cybersecurity, or biology work. These measures let us bring you Mythos-level capabilities sooner, and we're working to refine them. Switched to Opus 4.8. Send feedback with /feedback or learn more: https://support.claude.com/en/articles/15363606"
050
Jem Arnold @jemarnold.bsky.social · 26/06/2026
How long does it take for blood to make a full round-trip around the entire body during exercise? 🫁🫀🔁🦵 Only 10-sec! That’s way faster than I intuitively would have expected But we’re just reproducing what’s been known for the last century👇 #science #medicine #rstats #datavis
A figure showing near-infrared spectroscopy (NIRS) tracing over the vastus lateralis quadriceps muscle during a cycling VO2max interval, with indocyanine green (ICG) dye tracer injected into the median cubital vein at time 0:00. As the dye appears with blood flow in the VL under the probe, the optical signal rapidly reaches a peak at ~10-seconds after injection. The concentration briefly decays as the dye tracer flows out of the insonation site, then rises to a second and third peak at ~10-sec intervals, showing net transit time around the entire systemic circulation (from quadriceps, via venous blood back through lungs to heart, and out again via arterial circulation to the quadriceps). Figure title: “NIRS-ICG dye tracer monitored at vastus lateralis during cycling intervals. Systemic blood recirculation time ≈ 10 seconds”. Text label: “Dye concentration peaks under the NIRS probe every ~10-sec”. Caption: “Data: (manuscript in preparation) | Visuals: @jem_arnold”
3224
Jem Arnold @jemarnold.bsky.social · 25/05/2026
From whiteboard hypothesis to predictive model supporting H1 in a ~15 min conversation. Very satisfying! #rstats
Picture of whiteboard and screen. Whiteboard shows hand-drawn hypothesised relationship between muscle oxygen saturation and resistance exercise load, for individuals with "high" and "low" strength. Load is plotted as absolute (kg) and relative to one-rep max (%). 

Screen shows resulting plots from modelling the same relationships with linear mixed effects models. Modelled plots mirror the hypothesised relationships on the whiteboard. A satisfying result!
370
Jem Arnold @jemarnold.bsky.social · 25/05/2026
This is how we can resample breath-by-breath metabolic data to 1 Hz using `mnirs::resample_mnirs()` The secret is {mnirs} works on many time series data, not just NIRS 🤫 #rstats #nirs #cpet
Screenshot of code and plot showing how to use mnirs::resample_mnirs() to resample breath-by-breath metabolic data to 1 Hz sample rate. Plot shows BxB data points overlaid on the same interpolated data, showing how the time gaps between samples are filled.

library(mnirs)
library(ggplot2)

## breath-by-breath metabolic data
cpet_data

## resample to 1 Hz and linearly interpolate
cpet_resampled <- resample_mnirs(
    cpet_data,
    time_channel = TIME,
    resample_rate = 1,
    method = "linear"
)
cpet_resampled

ggplot(cpet_data, aes(TIME, VO2)) +
    theme_mnirs() +
    scale_colour_mnirs() +
    geom_point(data = cpet_resampled, aes(colour = "1 Hz")) +
    geom_point(aes(colour = "BxB"))
120
Reposted by Jem Arnold
Philip Skotzke @philipskotzke.bsky.social · 19/05/2026
Dear stats people, I'm looking for textbooks or other resources on test design and analysis to establish validity & reliability. Any recommendations & repost appreciated. PS: we have to respond to a reviewer and I want to make sure we're doing the right thing. #rstats #stats #science #AcademicSky
221
Jem Arnold @jemarnold.bsky.social · 16/05/2026
. @fredrikmentzoni.bsky.social here is that sensitivity analysis on smoothing levels for BxB Tymewear vs Parvo respiration rate Methods are un-smoothed; moving-avg by breath; moving-avg by time, and binned by time (reduce to single mean sample per bin)
230
Reposted by Jem Arnold
Cyclingnews @cyclingnews.com · 15/05/2026
'A tough period of racing while searching for answers' –Iliac artery surgery ahead for Neve Bradbury www.cyclingnews.com/pro-cycling/...
061
Jem Arnold @jemarnold.bsky.social · 13/05/2026
Woops! Found a substantial memory allocation issue in my code while trying to process a couple 300k+ row data frames. Think I've got it sorted now. Probably need to push a hotfix for this to CRAN 😬
010
Jem Arnold @jemarnold.bsky.social · 09/05/2026
I was just reminded of this nice test-retest reliability study for intensity at #Fatmax & fat oxidation (g/min) This week are we the red line or the blue line? How about next week?? 🤷‍♂️ Fatmax can be useful, but it isn't magic 🧙‍♂️ pubmed.ncbi.nlm.nih.gov/32488584/
Two-panel figure comparing test-retest values for Trial A and Trial B of (a) peak fat oxidation (g·min⁻¹) and (b) FATMAX (%V̇O₂peak). Individual participant data show wide variability between trials, connected between trials with lines. Blue and red coloured example lines highlight substantial inter-individual variability in changes between trials, where values might substantially increase or decrease between trials A and B.
220
Jem Arnold @jemarnold.bsky.social · 07/05/2026
Quick update {mnirs} 🦵🔦 0.6.3 pushed to CRAN Main improvement with plotting lists of data frames as facets, primarily for extracted intervals Here is how you can extract intervals by time values from data processed with #mnirs, for subsequent analysis (kinetics analysis coming soon🤞) #rstats #nirs
A screenshot of code excerpt from {mnirs} README https://github.com/jemarnold/mnirs/ demonstrating how to extract intervals by known time values to a list of data frames, then easily plot those intervals. Figure shows two facets with two muscle oxygen saturation channels each during rapid recover after exercise intervals for reoxygenation kinetics. Code excerpt below:

extract_intervals(): detect events and extract intervals

## return each interval independently with `event_groups = "distinct"`
distinct <- extract_intervals(
    nirs_data,                  ## channels blank for "distinct" grouping
    start = by_time(348, 1064), ## manually identified interval start times
    end = by_time(458, 1174),   ## interval end time (start + 150 sec)
    event_groups = "distinct",  ## return a list of data frames for each (2) event
    span = c(0, 0),             ## no boundary modification
    zero_time = FALSE           ## return original time values
)

plot(distinct, time_labels = TRUE)
150
Jem Arnold @jemarnold.bsky.social · 30/04/2026
Anyone else still use autohotkey shortcuts for writing special symbols? Or do the chatbots do it these days?🤔 I just handed down my old script to my grad student colleagues Works system wide, not just in Word! ΔV̇O₂ ≈ 5 ± 2 (mL·kg⁻¹·min⁻¹) 13°C β₁ ≤ α ≠ 𝜏 (†) ¯\_(ツ)_/¯ #academicsky #rstats
Screenshot of .ahk shortcuts:
; symbol, description, and literal execute string in quotations

:*?:/=::{U+2260}       ; ≠ not equal to "/="
:*?:~=::{U+2248}       ; ≈ approx equal to "~="
:*C?:p=::{U+221D}      ; ∝ proportional to "p="
:o?:<=::{U+2264}       ; ≤ less than or equal to "<="
:o?:>=::{U+2265}       ; ≥ greater than or equal to ">="
:*?:+-::{U+00B1}       ; ± plus minus "+-"
:o?:*::{U+00B7}        ; · multiplication dot "*`"
:o?:%::{U+00F7}        ; ÷ division sign "%`"
:*?:$$::{U+20AC}       ; € euro "$$"
:o?:**::{U+00B0}       ; ° degree "**`"
:oC?:alpha::{U+03B1}   ; α alpha "alpha`"
:oC?:beta::{U+03B2}    ; β beta "beta`"
:oC?:D::{U+0394}       ; Δ delta "D`"
:oC:u::{U+03BC}        ; μ mu "u`"
:oC?:tau::{U+1D70F}    ; 𝜏 tau "tau`"
:*?::``::{U+2234}      ; ∴ therefore ":`"
:*C?:V`*::V{U+0307}    ; dot(V) "V*"
:*C?:Q`*::Q{U+0307}    ; dot(Q) "Q*"
:o?:1::{U+2082}        ; subscript[1] "1`"
:o?:2::{U+2082}        ; subscript[2] "2`"
:o?:-1::⁻¹             ; superscript[-1]
151
Reposted by Jem Arnold
Chris Cooper @profchriscooper.bsky.social · 29/04/2026
@mnirs.bsky.social Abstract submissions now open for mNIRS 2026 in Pavia (Sept 17-19). Abstract deadline June 15 www.mnirs2026.org
mnirs2026.org
mNIRS 2026
043
Reposted by Jem Arnold
Robert Chung @rchung.bsky.social · 25/04/2026
The data speak for themselves but their voices can be soft and sly, especially non-experimental data. That's why our methods have to be cleverer, to find slim signals amidst noisy dross.
142
Jem Arnold @jemarnold.bsky.social · 23/04/2026
Just updated {mnirs} 🦵🔦 app with interactive Plotly for improved no-code workflow processing #muscleoxygenation #nirs #rstats data! Access here: jemarnold-mnirs-app.share.connect.posit.cloud 🔎 Pan & zoom to explore precise time scales 📈️ Compare effects of filtered vs raw tracings A bit more 🧵👇
150
Jem Arnold @jemarnold.bsky.social · 19/04/2026
{mnirs} 0.6.2🦵🔦 updated on CRAN with some minor changes: • ⏱️🌍 improved timestamp parsing and local time zone detection • 🛠️ Some other small fixes and documentation edits. `install.packages("mnirs")` The full changelog is available: 🔗 jemarnold.github.io/mnirs/news/i... #rstats #nirs
Changelog mnirs 0.6.2
CRAN release: 2026-04-18
030
Jem Arnold @jemarnold.bsky.social · 11/04/2026
Garmin sounds serious about #muscleoxygenation #mnirs. "Muscle Battery" gives me high hopes and cautious expectations 😄 What do you think?🤔 Very interested to see how they solve the hardware distribution problem, and how the model learns from repeated measurements
the5krunner.com
Garmin Leaks Trademarks - Two New Products highly Likely
Garmin has trademarked Muscle Battery, confirming SmO2 muscle oxygen hardware is coming, and CIRQA, its Whoop competitor. Full analysis of what the filings reveal about both products.
230
Jem Arnold @jemarnold.bsky.social · 10/04/2026
What is the best way to include an AGENTS.md file for users' bots working with a new #rstats package? Top level gives a CRAN check note. Or is {pkgdown} LLMs.txt sufficient? 🤔
Screenshot:

Preview AGENTS.md

# `{mnirs}` Agent Reference

**v0.6.2 | R | MIT** — workflow/dependency map. See `README.md` + vignettes for examples.

| | |
|---|---|
| **Author** | Jem Arnold |
| **Website** | https://jemarnold.github.io/mnirs/ |
| **Citation** | \<coming soon\> |

---

## 1. `"mnirs"` — data frame/{tibble} subclass

### Metadata

| Attribute | Type | Description |
|---|---|---|
| `nirs_channels` | character vector | NIRS signal column names |
| `time_channel` | character(1) | time column name |
| `event_channel` | character(1) | event/lap column name |
| `nirs_device` | character(1) | device name (auto-detected) |
| `sample_rate` | numeric(1) | Hz |
| `start_timestamp` | POSIXct | absolute start datetime |
| `interval_times` | numeric | set by `extract_intervals()` |
| `interval_span` | numeric(2) | span used in `extract_intervals()` |

`verbose` read from `getOption("mnirs.verbose", TRUE)` or pass explicitly.
Access: `attr(data, "nirs_channels")`.

---

## 2. Pipeline

```
read_mnirs()
  └── resample_mnirs()       # regularise time grid
        └── replace_mnirs()  # clean invalid/outliers/NA
              └── filter_mnirs()  # smooth
                    ├── shift_mnirs()    # optional: shift baseline
                    ├── rescale_mnirs()  # optional: normalise range
                    └── extract_intervals()
                              └── analyse_kinetics()
                                        └── plot() / print()
```
240
Jem Arnold @jemarnold.bsky.social · 09/04/2026
Just learned about a fun edge case when reading `hh:mm:ss` format from .xlsx, which Excel in its wisdom apparently stores as fractional numeric, resulting in a bit exaggerated sample rate estimates! Already tested and patched in dev. Should roll out with {mnirs} 0.6.2 by this weekend #rstats #nirs
screenshot of excel spreadsheet and the same spreadsheet read into R. `hh:mm:ss` column in excel shows timestamp values e.g.: "13:52:59", but these are actually fractional numeric values behind the scenes: "0.578". When read by `mnirs::read_mnirs()` this returns an info message declaring "Estimated `sample_rate` = 50000 Hz" which is a few orders of magnitude wrong. Next {mnirs} update will fix this issue!
150
Jem Arnold @jemarnold.bsky.social · 01/04/2026
Really nice #rstats Positron -> Quarto -> .docx workflow this afternoon: Assist from the chatbots to spell & grammar check, pre-format all my V̇O₂s & SmO₂s, and wrap all my {citations} for endnote. Then render to .docx and let Endnote instantly format the references. Worked once, flawlessly👌
Screenshot of manuscript title and subheadings: "mnirs: An R Package for Reading, Processing, and Analysing Muscle Near-Infrared Spectroscopy Data
Jem Arnold
2026-03-31"
150
Jem Arnold @jemarnold.bsky.social · 30/03/2026
First R package published! #mnirs #nirs #muscleoxygenation
090
Jem Arnold @jemarnold.bsky.social · 30/03/2026
Well, thanks for all the good advice #rstats community Because that was a far smoother first-time CRAN review process than you led me to expect 😄 6 days from submission to a nice short approval email. I'm as pleased with this as I was having my first academic paper published!
screenshot of email text reading "Thanks, on its way to CRAN"
2130
Jem Arnold @jemarnold.bsky.social · 24/03/2026
The fun of adding a new participant dataset and watching {targets} go brrrr As I learned from others, this is a great tool for reproducible project structure and processing pipeline (it also saves intermediate objects along the way) books.ropensci.org/targets/ #rstats
A code chunk and network visualisation diagram demonstrating a project pipeline for monitoring files and iterating function calls using R package {_targets}. Annotations on the networkvis diagram are "monitor unique participant files -> read and process -> synchronise & join -> analyse & plot -> summarise & export tables to file"
060
Jem Arnold @jemarnold.bsky.social · 21/03/2026
Pick a threshold, whichever one you want! Getting a number is cheap. Knowing what the number means and what to do with it is far more valuable #rstats #dataviz #exphys #sportscience
A raincloud plot showing the distribution of 11 metabolic threshold estimation methods (lactate and ventilatory thresholds) across relative workload (% Wpeak) from two trials each in 21 female and male competitive cyclists. Data from Yogev et al., 2023: https://doi.org/10.3389/fspor.2023.1143393. Thresholds are stacked vertically, colour-coded from red (FatMax; occuring at the lowest intensity) to pink (RER = 1.00, at the highest intensity), each displaying a kernel density curve, individual data points (n ≈ 42), and a white median marker. The intent is to visualise how various threshold estimates return values all along the range of relative intensity, thus suggesting that there is no single true intensity breakpoint, but rather that different methods find threshold-like behaviours at different intensities, depending on which metabolic variable and analyses methods are used.
1110
Jem Arnold @jemarnold.bsky.social · 18/03/2026
I've just updated {mnirs} 0.5.2 and implemented a Shiny app for a basic no-code workflow Check it out! Visualise your data quickly and compare effects of different processing methods jemarnold-mnirs-app.share.connect.posit.cloud ... then tell me when something breaks 😄 #rstats #mnirs
183
Jem Arnold @jemarnold.bsky.social · 07/03/2026
Positron Assistant keeps trying to throw code edits inappropriately at the top of my scripts, rather than at the intended lines. Very annoying. Any ideas why or fixes to try? 🤔 #rstats I have to reject and ask it to repeat the operation. Usually gets it right on the second attempt
Screenshot of .R script in Positron IDE with Positron assistant copilot edits suggested at the very top of the script, corrupting the true structure of the script, rather than at the right line location.
230
Reposted by Jem Arnold
Mid terms are November 3rd 2026. Go register voters. @usrbinr.bsky.social · 05/03/2026
imo -- making sure folks understand tibbles or just basically lists and lists are basically vectors goes and then showing how to subset vectors / lists goes a along way to unifying base R vs. tidyverse syntax
041
Reposted by Jem Arnold
Robert Chung @rchung.bsky.social · 04/03/2026
(Though I made exactly that same comment about cycling analytics back before any of the current big apps existed: they were diving into a single ride's data when the big potential was looking at trends, patterns, and deviations from pattern across rides).
121
Reposted by Jem Arnold
Ulrich Atz @ulrichatz.org · 02/03/2026
You add the posit marketplace, install r-lib, and invoke the skill at an opportune moment (or claude code runs it for you with the right trigger words). The README has some instructions. github.com/posit-dev/sk...
github.com
GitHub - posit-dev/skills: A collection of Claude Skills from Posit
A collection of Claude Skills from Posit. Contribute to posit-dev/skills development by creating an account on GitHub.
021
Reposted by Jem Arnold
Michael Friendly @datavisfriendly.bsky.social · 02/03/2026
Be extra careful with the Description: -- quote software names, beware of spelling, use proper DOI refs, ... "Newbies" -- packages, not maintainers are put through a special room in CRAN-Hell 👿
011
Reposted by Jem Arnold
Ulrich Atz @ulrichatz.org · 01/03/2026
use this skill for some extra help on the arcane: github.com/posit-dev/sk...
github.com
skills/r-lib/cran-extrachecks at main · posit-dev/skills
A collection of Claude Skills from Posit. Contribute to posit-dev/skills development by creating an account on GitHub.
141
Reposted by Jem Arnold
Ben Bolker @bbolker.bsky.social · 01/03/2026
"newbies" check (pkgs w/o prior releases on CRAN) have a particularly fussy human-administered set of checks (e.g. do all functions have explicitly documented return values?) Also, things like spell-check false positives (can be fixed via dirk.eddelbuettel.com/blog/2017/08... )
dirk.eddelbuettel.com
Thinking inside the box
Dirk Eddelbuettel, R, C++, Rcpp
111
Reposted by Jem Arnold
Dirk Eddelbuettel @eddelbuettel.com · 01/03/2026
Run R CMD check --as-cran, and read the CRAN Repository Policy document and Writing R Extensions carefully (they are long and dense and document updates poorly...). Don't expect perfection. Iterate. Feedback from the review is normal as we cannot run all their checks (their bug, not ours). #rstats
081
Jem Arnold @jemarnold.bsky.social · 01/03/2026
Dear #rstats mentors, what advice do you wish someone would have given you before submitting to CRAN for the first time? The obvious, and the less so
781
Jem Arnold @jemarnold.bsky.social · 01/03/2026
Metabolic threshold detection should combine expert manual selection with a locally weighted piecewise fit/changepoint model Beyond my current time availability and skill limits to develop, but I'd love to see how it works
230
Reposted by Jem Arnold
tj mahr 🤘 @tjmahr.com · 28/02/2026
Find() faster than a loop too
+ )
# A tibble: 3 × 13
  expression       min   median `itr/sec` mem_alloc `gc/sec` n_itr  n_gc
  <bch:expr>  <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl> <int> <dbl>
1 which_apply  50.03ms  116.8ms      8.18    2.49MB     4.03    67    33
2 Find          8.39ms   12.2ms     70.9     9.69KB     2.19    97     3
3 loop          11.7ms     20ms     50.3    26.08KB     2.64    95     5
# ℹ 5 more variables: total_time <bch:tm>, result <list>, memory <list>,
#   time <list>, gc <list>
011
Jem Arnold @jemarnold.bsky.social · 27/02/2026
TIL `Find()` returns the first match then stops searching. 10x speed and 40x memory improvement in one of my core package functions! I wonder where else I can implement? 🤔 #rstats #mnirs
library(mnirs) ## development package
library(bench) ## benchmarking

## read file to a data frame (internal fn)
data <- mnirs:::read_file(example_mnirs("train.red"))

## column name strings to match all
nirs_channels <- c("SmO2 unfiltered", "HBDiff unfiltered")

## return bench::mark results
bench::mark(
    ## previous code searched through all rows
    which_apply = {
        which(apply(data, 1L, \(.row_vec) {
            all(nirs_channels %in% .row_vec)
        }))
    },

    ## TIL about `Find()` which returns the first match and stops
    Find = {
        Find(\(.i) {
                all(nirs_channels %in% data[.i, ])
            }, seq_len(nrow(data)))
    },
    check = TRUE,
    iterations = 100
)
#> # A tibble: 2 × 6
#>   expression       min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr>  <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 which_apply   31.5ms  34.89ms      27.1    2.56MB     86.0
#> 2 Find          2.73ms   3.03ms     304.     63.2KB     26.4
3151
Jem Arnold @jemarnold.bsky.social · 19/02/2026
Sport scientists love finding corners on a circle 😄
A cartoon meme template with a person looking at a computer screen and saying "show me a breakpoint". The computer answers "here is a breakpoint" and the screen shows the classic Jamnick et al, 2018 image of multiple lactate breakpoints on a lactate curve, with obviously no real "breakpoint" per se. The person answers "oh my god", as a commentary that when we ask a computational algorithm to find a breakpoint on a partial circular line, it will give us a breakpoint, whether or not it is physiologically meaningful. The corner of a circle, if you will.
161
Jem Arnold @jemarnold.bsky.social · 19/02/2026
Now working with comma decimal separated files thanks to Philip's help 😊
030
Reposted by Jem Arnold
Philip Skotzke @philipskotzke.bsky.social · 19/02/2026
You work with NIRS data? Check out this great R package 📦 I had the chance to test it already, I wish I had it when analyzing the data of my last study
021
Jem Arnold @jemarnold.bsky.social · 18/02/2026
For anyone frustrated by processing #NIRS data, I've been working on {mnirs} an R package I think can help with standardisation Take a look: github.com/jemarnold/mn... Get in touch if interested. I'm looking for more users to provide feedback and break things. More info to come 🦵🔦 #mnirs #rstats
071
Jem Arnold @jemarnold.bsky.social · 16/02/2026
Interesting difference in perspective on productivity. Looking at the picture, I assumed the more contributions, the more your grass would grow
250