r/rstats 20h ago

RDesk - building desktop apps with R backend

23 Upvotes

Hi all,

Just released an update for RDesk v1.0.7 on CRAN. It's a small

framework for turning R code into standalone desktop

applications with web-based frontends.

A realistic heads-up: this isn't a plug-and-play or drop-in

replacement for existing setups like Shiny. Because of how

it's designed (it bridges an embedded web view directly to

an R session), you do have to structure your code a bit

differently. The UI is written in standard HTML/JS, and your

R backend responds to events through message handlers and

async jobs rather than traditional reactive graphs.

Right now, it's focused on Windows (using the native WebView2

runtime), and build_app() packages your scripts, packages, and

a matching R runtime into a distributable zip. Linux and macOS

support is in active development on the dev branch, not on

CRAN yet.

If building standalone desktop tools is something you've

needed or explored, I'd love for you to give it a spin and

share any thoughts or constructive feedback.

CRAN: install.packages("RDesk")

GitHub & Docs: https://github.com/Janakiraman-311/RDesk

Thanks for reading!


r/rstats 16h ago

I recently learned about Lexis diagrams. I was so impressed by their ability to reveal patterns in data that I wrote an article about them. [OC]

Post image
6 Upvotes

r/rstats 17h ago

Tidysem: problem converting my binary variables to "mxFactor" "ordered" "factor"

1 Upvotes

Hi,

I'm trying to convert my binary variables to "mxFactor" "ordered" "factor" variables, but when using the following code i get just "ordered" "factor". which cause an error when trying to conduct a latent class analysis:

# Convert female to numeric safely, then to an ordered OpenMx factor

> df$female <- as.numeric(as.character(df$female))

>

> # Confirm it only contains 0, 1, and possibly NA

> table(df$female, useNA = "ifany")

0 1

2341 1674

>

> # Make it an OpenMx ordinal factor

> df$female <- OpenMx::mxFactor(

+ df$female,

+ levels = c(0, 1)

+ )

>

> # Verify the result

> class(df$female)

[1] "ordered" "factor"

> table(df$female, useNA = "ifany")

0 1

2341 1674

> library(OpenMx)

>

> df$female <- OpenMx::mxFactor(

+ df$female,

+ levels = c(0, 1)

+ )

>

> class(df$female)

[1] "ordered" "factor"

> table(df$female, useNA = "ifany")

0 1

2341 1674


r/rstats 23h ago

How to do Thematic Evolution, It appears blank for me

0 Upvotes

I don't know why it doesn't want to make the themtic evolution... What's wrong? What should I do (first time using it)


r/rstats 1d ago

R Consortium Now Accepting Submissions for Technical Grants

7 Upvotes

The R Consortium is now accepting submissions for our second 2026 technical grant cycle.

We fund projects that strengthen R’s technical and social infrastructure — open-source tools, packages, and community programs that help R users everywhere.

Applications close October 1, 2026, at 11:59 p.m. US ET.

Find out more details and submit your proposal: https://r-consortium.org/posts/r-consortium-now-accepting-submissions-for-technical-grants/


r/rstats 2d ago

Reccomended R 4.6.1 or related program guides and tutorials.

7 Upvotes

Hi, I'm a media and communications student. My university has updated my bachelors curriculum and now uses R 4.6.1 to teach. If anyone has any tutorials or guides (does not have to be media related) it would be very helpful.

I have dyscalculia, so I have to practice twice as hard and adapt twice as fast for things to stick. So a slow or more rudimentary tutorial would work the best.

Thank you!


r/rstats 3d ago

R Consortium welcomes two new Board members: Francesca Lazzeri (Microsoft) and Mutaz M. Jaber (Gilead Sciences)

32 Upvotes

We're happy to welcome two new members on the R Consortium Board of Directors, and six that continue to serve!

Together, they are filling positions at the Premier and Core level.

  • Francesca Lazzeri, Ph.D. of Microsoft joins as a Premier Member
  • Mutaz M. Jaber of Gilead Sciences joins as a Core Member
  • Mike K Smith of Pfizer continues as Board Chair, alongside our returning directors

We are honored to have their expertise at the R Consortium!

More here: https://r-consortium.org/posts/meet-our-2026-r-consortium-board-of-directors/


r/rstats 3d ago

An alternative text generator for charts made with ggplot2 in R

28 Upvotes

Hi! I'm working on an R package called ggalttext that takes a ggplot2 chart as input and returns alternative text (required for accessibility) for that chart.

The goal is to provide a very simple and lightweight way of adding meaningful alt texts to charts made with ggplot2.

It does not use AI or OCR technologies, but instead inspects the plot structure/content and uses some (more or less) naive heuristics to figure out what the chart looks like and how to describe it in a single sentence.

It's already available on CRAN, but I'm working on the next release, which fixes some edge cases.

Example usage:

library(ggplot2)
library(babynames)

plot_data <- babynames |>
    subset(name %in% c("Amanda", "Jessica", "Patricia", "Deborah", "Dorothy", "Helen"))

plot <- ggplot(plot_data, aes(x = year, y = n, group = name, fill = name)) +
    geom_area() +
    theme(legend.position = "none") +
    labs(title = "Popularity of American names in the previous 30 years") +
    theme(
        legend.position = "none",
        panel.spacing = unit(0.1, "lines"),
        strip.text.x = element_text(size = 8)
    ) +
    facet_wrap(~name, scale = "free_y")


ggalttext::generate_alt_text(plot)
# "Area chart split into 6 small charts arranged in a 2-row by 3-column grid,
# titled “Popularity of American names in the previous 30 years”."

r/rstats 3d ago

mgcv GAM: persistent low k-index for study-day smooth despite k = 40 — increase k or rethink temporal structure?

5 Upvotes

I’m fitting a Beta GAM in mgcv to model the proportion of daytime outdoor-use time in laying hens. The response is the proportion of minutes spent outdoors during an 08:00–22:00 observation window, and the model contains repeated observations from individual hens.

My current model is approximately:

prop_outside ~
  coop_id +
  s(study_day, bs = "cr", k = 40) +
  s(max_temp, bs = "cr", k = 8) +
  s(mean_dew_point, bs = "cr", k = 7) +
  rain_any +
  s(log_total_rain, by = rain_status, bs = "cr", k = 7) +
  s(eid, bs = "re")

using:

family = betar(link = "logit")
method = "REML"

The dataset contains roughly 8,800 positive hen-day observations from 124 hens across about 137 study dates. The model explains about 60% of the deviance.

The issue is the study_day smooth. On a same-row model comparison, I get:

s(study_day)
k'       = 39
edf      = 34.58
k-index  = 0.949
p-value  < 0.001

I also tried an alternative weather specification using mean temperature, mean humidity and mean wind instead of maximum temperature and dew point:

prop_outside ~
  coop_id +
  s(study_day, bs = "cr", k = 40) +
  s(mean_temp, bs = "cr", k = 8) +
  s(mean_humidity, bs = "cr", k = 8) +
  s(mean_wind, bs = "cr", k = 8) +
  rain_any +
  s(log_total_rain, by = rain_status, bs = "cr", k = 7) +
  s(eid, bs = "re")

The same issue persists:

s(study_day)
k'       = 39
edf      = 34.84
k-index  = 0.966
p-value  = 0.0175

The study-day smooth is visually quite wiggly, particularly early in the study, and the EDF is already fairly close to the available basis dimension. Changing the weather specification does not materially improve overall fit: both models explain about 60% of deviance and have essentially identical AIC.

There is also substantial temporal/weather dependence. For example, in the alternative model, observed concurvity is about 0.90 for mean temperature and 0.48 for study day.

My questions are:

  1. Is the low k-index plus EDF ≈ 35/39 sufficient reason to increase k for study_day, for example from 40 to 60?
  2. If increasing k gives essentially the same fitted curve/predictions but the k-check remains significant, would you consider the current smooth adequate?
  3. Could this be indicating residual temporal autocorrelation rather than simply an insufficient basis dimension?
  4. Would you model study date differently in this setting—for example with an autocorrelation structure, a different smooth basis, or another temporal term?
  5. Since weather variables themselves follow study date seasonally, how would you distinguish genuine temporal structure from weather-related temporal confounding?

My current plan is to compare k = 40 and k = 60 on the same observations and assess whether fitted values, the study-day effect, held-out-date prediction, and conclusions materially change, rather than selecting the model based only on the k-check p-value.

I’d appreciate advice on how to interpret this persistent study_day diagnostic and what additional diagnostic/model comparison would be most appropriate.


r/rstats 4d ago

renv bootstrapping compatibility RStudio v Positron

22 Upvotes

Just solved a problem that might be relevant for others and took me a while to pin down.

I have a project developed in Rstudio and using renv. At some point the .Rprofile was amended to place source("renv/activate.R") INSIDE a .First <- function(), with some other stuff that we wanted to run when starting R for this project.

One of our users transitioned to Positron, and we just couldn't get the .Rprofile to run properly and start renv.

The fix was to place source("renv/activate.R") at the top level of .Rprofile, outside of any .First function.

According to claude this is to do with the way that the Rstudio startup sequence differs from VS Code/Positron.

Hope this saves someone else a few hours...


r/rstats 4d ago

Law & PR background -> just published my first R analysis (mapped Coldplay's Spotify keys to fundamental Hz)

Thumbnail github.com
11 Upvotes

Hey everyone,

I recently moved into data after studying law and communications, and I just finished my first complete R project using tidyverse and rmarkdown.

Spotify's API returns musical keys as pitch class integers (0–11).

I mapped them to their fundamental frequencies in Hz (f=440×2n/12) to see at what frequencies Coldplay actually vibrates across 20 years of albums.

Turns out their most-used fundamentals are E (330 Hz) and A (440 Hz), with very little pitch drift over time.

Repo is here: https://github.com/frequencymatch/coldplay-in-hz

As a beginner in R, I'd love any feedback on the Rmd structure or the code itself!


r/rstats 5d ago

Recommended books after ISLP

20 Upvotes

Hey everyone, math major here, looking to pursue a statistics minor. I've been working through Introduction to Statistical Learning with Python by Gareth James(ISLP), and others. I'm almost finished with it and have been looking at other books I might be interested in.

Just a quick summary for anyone that hasn't read it. ISLP covers topics including:, linear and non linear regression and classification, basic probability and statistics, cross validation, common shallow ML algorithms, deep learning, neural networks. From a very practical and non-techinal way. Basically you read a lot of "This works because reasons, moving on". Best way I would describe it is "intuition slop" .

I was looking for something more theoretical as ISLP is pretty light on the theory and focuses more on intuition and generalization. Although I want a more theoretical book, I still would prefer it to contain some applications and or assignments that I could do to practice my coding because as a math major I feel as though my programming is lagging behind. Are there any specific books you would recommend.

Also I'm taking machine learning this semester and our assigned book is "Hands-On Machine Learning with Scikit-Learn, Keras and TensorFlow" by Aurelien Geron. So I'll probably be reading it in bits and pieces, but I still want another book that I can focus on outside of classes. I appreciate any responses.


r/rstats 6d ago

$3, one weekend, and a shareable Alone survival analysis: notes on Hadley’s AI workflow

19 Upvotes

https://tidydesign.substack.com/p/y-code-when-ai?r=15f9ap&utm_campaign=post&utm_medium=web

I wanted to try the AI-in-the-IDE workflow Hadley Wickham has been writing about, so I used it on a project I already know well: survival analysis of Alone as each season unfolds.

After sitting with it for a week, going back to the old way sounds horrible. I’ll be using this again.

The biggest change was not that the models wrote cleverer models. It was that I ended up with something I was willing to show other people.

Previously I would not have spent the effort polishing comments, a data dictionary, and structure so someone else could follow it — or had much confidence I wasn’t doing something quietly dumb. The useful part was the admin and the second opinion: documentation, comments, and a sense-check of the methods.Repo: https://gitlab.com/weekly_analysis/alone-hw-method

Setup: LibreChat with Anthropic as the “strategic thinker,” and the Continue extension with three Gemini models and two DeepSeek models as the “hands.”Weekend cost was about $3. Some of that was me burning tokens while I learned how to talk to the add-on; next time should be cheaper. Hadley flags Gemini as the cost-effective option. In my case DeepSeek was cheaper, and Gemini kept returning “model unavailable” for the Flash version I wanted, which meant waiting or switching to something worse or more expensive. DeepSeek never did that. When I needed it 3.1 pro was excellent and never stalled me out, but I was missing the most useful option, a reliable affordable 'daily driver' without going outside Gemini which is a shame, I tried again this weekend and found the problem worse, but maybe I could get what I need without waiting by using a SLIGHTLY different model than 3.7 Flash.

If you already use AI to help write R and want the next step beyond paste-into-a-chatbot, this setup is worth a weekend. Happy to share the Continue/LibreChat bits if useful;


r/rstats 6d ago

R users: what does your actual setup look like?

42 Upvotes

I'm working on a Linux-based workstation setup aimed at economists and other quantitative researchers. R support is one of the last major pieces I need to settle.

I mainly use Python and VS Code, so I don't want to assume that my preferred setup makes sense for regular R users. I'm interested in what people actually use:

  1. What operating system do you use for R?
  2. What is your main editor or IDE? RStudio Desktop, RStudio Server, Positron, VS Code, or something else?
  3. Do you use one shared R package library, project-specific environments with renv, or a mixture?
  4. Do you install R or R packages through Conda/Mamba? Is that mainly for projects that mix R and Python?
  5. Do you work locally, on remote servers or HPC systems, or in containers?
  6. What supporting tools do you regularly need, such as Quarto, Jupyter, TinyTeX, compilers, or external libraries?
  7. Do you need multiple R versions?

I'm also interested in package developers. Does your development setup differ from your normal analysis setup? What would you expect to find on a fresh workstation before you considered it ready for R work?

You don't need to answer everything. Short descriptions of your setup, unusual requirements, and recurring setup problems would all help.

If useful, here is a template:

OS:
Main editor/IDE:
Local or remote:
Package-library strategy:
How R is installed:
Conda/Mamba:
Mix R and Python:
Develop R packages:
Biggest setup annoyance:

Edit: Thank you all for taking the time to respond. I wasn’t expecting such a wide variety of responses.


r/rstats 6d ago

LungCapData by Mike Marin

4 Upvotes

hi everyone,

does anyone have the dataset used by Mike Marin in this tutorial video series?

https://www.youtube.com/watch?v=riONFzJdXcs&list=PLqzoL9-eJTNBDdKgJgJzaQcY6OXmsXAHU&index=2

I'm new to R and I wanted to get to know it a little bit and try it out to see if I'll be able to use it or not. I've already search this sub for recommended free resources for beginners to learn the basics. However, I found this nice playlist that I'd like to follow along just to get an overview, and I'd like to imitate and reproduce what Mike does, that's why I'm looking for the dataset he uses.

Thanks for the help. if you have any other suggestion, it's more than welcomed!


r/rstats 8d ago

A new take on documentation sites for R packages

Thumbnail bjarkehautop.github.io
18 Upvotes

My blog post covering two small packages for styling altdoc sites:

  • altdown: Style altdoc site like a pkgdown (Bootstrap 5) site (reason why explained in the blog post).
  • reftip: Adds preview on function signature on hover, and more robust handling of hyperlinks.

They can be used alone or together, as shown in my toy package alttip.

Please let me know what you think!


r/rstats 7d ago

cbcTools

Thumbnail
2 Upvotes

r/rstats 8d ago

Early-career marine biologist looking to collaborate on R/data analysis projects

3 Upvotes

Hi everyone!

I’m an early-career marine biologist currently completing my BSc in Marine Biology, and I’m looking to connect with researchers, students, conservationists, and others working with biological or environmental data.

I’ve been developing my skills in R, particularly for data cleaning, statistical analysis, ecological modelling, and data visualization. I genuinely really enjoy working in R, and at this stage I want to get involved with as many different projects and datasets as I reasonably can.

If anyone has a marine science, ecology, conservation, fisheries, wildlife, or other biological dataset that could use some additional help with analysis in R, I’d be happy to contribute. I’m also open to projects outside of marine science if there is an opportunity to work with interesting data and learn something new.

I’m not looking to charge anyone. My main goal is to gain experience working with different types of real-world data, improve my R skills, contribute where I can, and hopefully meet and build connections with people working in science and research.

I also recently created a GitHub where I’ll be archiving my projects as I continue learning. I uploaded a project I finished about a week ago involving the analysis of BRUV data and whitetip reef shark habitat associations.

GitHub: https://github.com/kylealibz

If you have a project where another person helping with the r/data side would be useful, feel free to message me. I’d also be happy just to connect with other early-career researchers and R users.

Thanks!


r/rstats 8d ago

New from the R Consortium nlmixr2 Working Group: the covariance step in nlmixr2 7.0, all grown up!

8 Upvotes

nlmixr2 is an R Consortium Working Group building open-source nonlinear mixed-effects modeling in R suitable for regulatory submissions.

In a follow-up to the 7.0 release, Matthew Fidler covers a frequently requested feature - a fuller, more flexible covariance step after model fitting.

What's new:

• Nearly any covariance method can be requested from nearly any estimation method

• Switch a finished fit to a different covariance method without refitting

• The default covariance step now covers every estimated parameter, not just structural ones - so residual-error terms can return SEs, %RSE, and confidence intervals in $parFixed

Read the cross-post on the R Consortium blog: https://r-consortium.org/posts/nlmixr2-7-0-covariance-step/


r/rstats 9d ago

ggvariant 0.2.0 'Tidy, 'ggplot2'-Native Visualization for Genomic Variants'

Thumbnail
josh45-source.github.io
10 Upvotes

Hey, just wanted to share ggvariant: A simple, opinionated toolkit for visualizing genomic variant data using a 'ggplot2'-native grammar. Accepts VCF files or plain data frames and produces lollipop plots, consequence summaries, mutational spectrum charts, and cohort-level comparisons as standard 'ggplot2' objects.  It's on CRAN


r/rstats 9d ago

c5tree update — new C++ backend, same accuracy, much faster fitting

0 Upvotes

Put out a new release of c5tree, my C5.0 decision tree implementation for Python. Main change is a rewritten C++ core replacing the old pure-Python fit routine.

Ran benchmarks against the previous PyPI release and against sklearn's CART, across breast_cancer, iris, and wine.

Fit time: new version is somewhere between 4x and 50x faster than the old pure-Python one depending on dataset size. Still slower than sklearn CART, which isn't surprising given how optimized that codebase is.

Predict time: roughly the same as before, and both versions are a bit slower than sklearn here — this is probably where I'll focus next.

Accuracy: identical between old and new versions on every dataset, both holdout and 5-fold CV. So no regressions, just faster training. Comparable to CART overall, slightly ahead on the wine dataset.

Chart with all four comparisons is attached. Happy to answer questions about the implementation or take suggestions for other datasets to test against.

Repo/install: https://pypi.org/project/c5tree/#description

https://github.com/vinaykumarkv/c5tree


r/rstats 9d ago

R Package: oRm an object relational model package for working with databases in R.

Thumbnail kent-orr.github.io
13 Upvotes

r/rstats 9d ago

[R] evoFE 1.0.0: Automated Evolutionary Feature Engineering with One-Liner Bayesian Tuners & Island Ensembling

10 Upvotes

I’m excited to announce that evoFE 1.0.0 is now on CRAN (a major leap forward from the initial 0.1 release).

What is evoFE?

evoFE is an R package for automated feature engineering using genetic programming. Instead of manually brainstorming interaction terms, nonlinear scalings, or encodings, evoFE evolves candidate transformation recipes and evaluates them directly against gradient boosted trees or linear models.

What's New in 1.0.0?

  1. Zero-Boilerplate "One-Liner" Bayesian Tuners: Pass evaluator = "lightgbm_mbo" to automatically tune tree depth, learning rate, and subsampling via mlr3mbo during evolution. Or wrap any custom model (like XGBoost) with make_tunable().
  2. 42+ Built-in Transformers: Arithmetic, group-by aggregations (mean, median, SD, quantiles), target encodings, WoE, UMAP embeddings, Genie & Lumbermark MST graph clustering, date differencing (date_diff), and custom transformer registration.
  3. Hybrid Active Feature Masking: Mutates and selects raw input features simultaneously with derived features, guided by baseline feature importance.
  4. Hierarchical Gene Chaining: High-performing features from earlier generations serve as inputs for subsequent compound transformations.
  5. Island Models & Topologies: Runs independent sub-populations across Ring, Torus, Grid, or Hypercube topologies with demand-driven Gibbs pull migration.
  6. Caruana Island Ensembling (ensemble_islands()): Combines diverse island champion recipes using Caruana post-hoc forward selection with replacement.
  7. Leakage-Safe Validation: Native support for time-series (cv_strategy = "time"), grouped entity validation (cv_strategy = "group"), and untouched confirmation holdouts (holdout_frac) with search-gap diagnostics.
  8. Dynamic BIC Regularization: Asymptotic BIC / PAC-Bayes penalties scaling with sample size NN to prevent feature bloat.

Minimal Example:

install.packages("evoFE")
library(evoFE)
# Evolve features + Bayesian tuned model
recipe <- evolve_features(
  data         = mtcars,
  target_col   = "am",
  task         = "classification",
  evaluator    = "lightgbm_mbo",  # Built-in one-liner Bayesian Optimization tuner
  generations  = 5,
  pop_size     = 8,
  holdout_frac = 0.20
)
# Inspect evolved recipe & search gap
summary(recipe)
# Predict on new data
test_features <- predict(recipe, newdata)
predictions   <- predict_model(recipe, newdata)

Feedback, suggestions, and bug reports are very welcome!


r/rstats 10d ago

An information-theoretic based PCA (code in R)

21 Upvotes

I wanted to share a new method called the Entropic Scree. If you need to estimate the dimensionality of a dataset but standard tools are struggling with noise or giving crazy estimates, it might be worth your time to take a look.

Instead of evaluating linear variance, rank, or Euclidean distance like established PCA methods, this new approach evaluates a transformed mutual information metric. It’s meant to be more effective for dealing with non-linearities, mixed data types, or environments where your variables exceed your samples.

The original function and the simulations are available in R (see GitHub repo). There is also a preprint that covers the methods in detail.

Would love to hear your thoughts/experiences if you give it a try.

GitHub Repo: https://github.com/tjleestjohn/Entropic-Scree

Zenodo Preprint: https://doi.org/10.5281/zenodo.22028087


r/rstats 10d ago

Sorting UserIDs into time sensitive groups, some UserIDs might feature into more than one group at different times.

2 Upvotes

I have a database of patients who have received a cancer diagnosis, some are metastatic, some are non metastatic. This includes the date of each diagnosis.

I have a different document with the recorded PSA values and the date it was recorded on. Each patient has more than one PSA value recorded.

The two data frames share a UserID that I can use to find out which PSA values belong to which patient. I am trying to determine which PSA values pertain to metastatic patients and which pertain to non metastatic patients.

What I think I should do is for each patient determine the turning point where they moved from the non metastatic group to the metastatic group.

Then merge the two documents so that PSA values get associated with cancer stage according to whether the PSA test was done before or after the turning point.

First data frame looks like:

UserID CancerStage DateofDx

5131 non-metastatic 12/05/2023

5131 non-metastatic 16/07/2024

5131 metastatic 21/02/2026

3285 metastatic 08/07/2025

2387 non-metastatic 01/03/2025

Second data frame looks like:

UserID PSA_value DateofTest

5131 2 13/07/2023

5131 3 18/09/2024

5131 18 22/03/2026

3285 23 06/08/2025

3285 12 13/04/2026

2387 1 05/06/2025

2387 0.5 06/03/2026