The full code connects to a database via API, retrieving only the variables needed by parsing the equations from a csv file. It then either returns the data to R or writes it to an xlsx file — organized by cognitive test or site — to help address any incorrect values.
Posts by Brian Helsel
Recently had a great experience using {rlang} in #RStats. I had over 50 equations for scoring cognitive tests that needed checking across hundreds of participants. Instead of writing checks for each one, parse_expr + eval_tidy let me map through equations and flag discrepancies. A simple example:
Haha, I’d love to see it! Maybe someday I’ll have that many but I’m dealing with 8 cores now.
Counting as high as you can in 10 seconds:
Me: 41
R: 1,152,791
C++: 448,971,124
Same task. Very different speeds. Programming is fun. #RStats
I’ve just published {typeR}, a small R package that lets you simulate live typing. It prints code
To install:
devtools::install_github("fgazzelloni/typeR")
If you teach or demo R, I’d love your feedback on how it works for you. #rstats #rpackages
Very nice! A clear example and better alternative to the one I posted so that only the needed branch is evaluated. Thanks for sharing the code!
# tweak to avoid running both branches
`%?%` <- function(test, yes) {
t <- function() test
y <- function() yes
list(test = t, yes = y)
}
`%:%` <- function(lhs, no) {
if (lhs$t()) lhs$y() else no
}
if (TRUE) 1 else 0
if (FALSE) stop() else 0
TRUE %?% 1 %:% stop()
FALSE %?% stop() %:% 0
R is a flexible programming language. You can even shape function syntax to resemble other languages. Here is an example of a ternary style operator with infix functions—the same logic as ifelse. Is this something you need? Probably not. But it is fun to explore these ideas within your code. #RStats
Yes, there are so many options! Thanks for all your work on the Rcpp package. I've enjoyed using it and learning more about C++.
An image of R code that shows different ways to the mean of a squared vector. The code uses a for loop, the apply family, purrr package, vectorized base R and a C++ function.
One of my favorite parts of R is that there are many paths to the same result. A simple task can be written with a for loop, the apply family, purrr, vectorized base R, or even Rcpp. The real skill isn’t memorizing syntax—it’s knowing when to choose each option. #RStats
I am always amazed by the amount of useful tools that R can provide. Truly a multipurpose programming language!
#RStats
I’ve been experimenting with tidyverse and the idea of an interactive console for data exploration. This would let you quickly explore, filter, and summarize data without writing code. The idea is to support a fast, conversational-style data workflow, especially useful for early exploration. #RStats
R Code Illustrating a Function Factory Example
I found that I was rewriting the same R function to read in data for a research study. A function factory returns a function and allows you to reuse logic, creating consistent readers that still allow custom processing. Less duplication, clearer intent, and much easier to extend. #rstats
I really like using air in Positron too! There have been a few instances where I didn’t like the formatting and found that adding # fmt: skip on the line above was an easy solution. It is also great at letting you know when you have a formatting error as nothing changes when you save it.
Last 2025 post, on @python.org & @carpentries.carpentries.org values, a great @posit.co conf session feat @mchow.com @richmeister.bsky.social @davisvaughan.bsky.social, the magic of #rstats #python dev cultures sharing best practices, and random #rstats history
www.emilyriederer.com/post/py-rgo-...
We're hiring @umkines.bsky.social - two open searches for new faculty with expertise in the Social and Behavioral Science of Physical Activity (one open-rank tenure-line, one academic clinical asst/assoc). Details at myumi.ch/A1DDM
Truly a unique and innovative position! I don’t think I’ve seen a Data Science & AI focus within a Kinesiology program but it will be interesting to read the research that results from these hires.
I’m always amazed by what you can do with maps in R. They’re not part of my everyday workflow, but I’ve started learning more and want to dive deeper.
foundational to maintaining our physical and cognitive health as we get older. We are grateful for this opportunity to bridge research and real-world impact in partnership with the community. Read more about our project!
frontiersctsi.org/news-events/...
trials into an accessible, community-driven digital health tool that promotes healthy lifestyles for individuals with intellectual and developmental disabilities. Our focus is on helping people get fit, move more, eat healthy, manage stress, sleep well, and stay connected. These areas are…
Dr. Amy Bodde, PhD, MPH and I were recently awarded the Frontiers CTSI Integrating Special Populations Trailblazer Award to support our team’s work with the Community Health Improvement Program for Intellectual Disabilities (CHIP-ID). Through this project, we will translate evidence from clinical…
I was glad to be able to attend with a few people from our University of Kansas Medical Center team. The take home message from our workshop was that sleep and physical activity have an important role in brain health and that the whole day matters. So let’s move more, sit less, and sleep well!
I enjoyed presenting at the 2025 annual meeting for the National Down Syndrome Congress this year. The energy and excitement at this conference is unmatched! Presenting for families and self-advocates was an honor.
2. Weight loss may be an early sign of Alzheimer’s in adults with Down syndrome, tracking with brain & memory changes. pubmed.ncbi.nlm.nih.gov/40545561/
3. We share best practices for online exercise programs tailored to individuals with intellectual disabilities. pubmed.ncbi.nlm.nih.gov/40492527/
New research published in the past month by team on physical activity, Alzheimer's, and Down syndrome:
1. A 12-month remote group exercise trial increased physical activity and fitness and showed promise for Alzheimer’s prevention in adults with Down syndrome. pubmed.ncbi.nlm.nih.gov/40520478/
New pubication! Resting metabolic rate (RMR) equations often overestimate energy needs in adults with #DownSyndrome. Our study found that most equations over-predicted RMR, except the Bernstein fat-free mass equation, which showed statistical equivalency.
onlinelibrary.wiley.com/doi/10.1111/...
These findings emphasize the importance of tailored interventions to promote physical activity across different populations. Let’s work toward a future where everyone has access to movement-friendly environments! #DownSyndrome #Alzheimers #PhysicalActivity #InclusiveHealth
Caregiver activity levels are linked to how much movement individuals with Alzheimer's disease get. Strength, aerobic fitness, and agility play a role in physical activity, and caregivers' movement patterns influence their loved ones.
journals.sagepub.com/doi/10.1177/...