Skip to main content

R Language Collective

A collective where data scientists and AI researchers gather to find, share, and learn about R and other subtags like knitr and dplyr.
516.2k Questions
+42
15k Members
+95
Contact

Pinned Bulletins

View all 1 bulletins

R Language has some news to share

Bulletin
1 min read
3k views

Welcome to the R Language Collective

Pinned content

View all 3 collections

R Language admins have deemed these posts noteworthy.

Pinned
20 votes
3k views
Collection

R Language Frequently Asked Questions

The questions that get asked repeatedly, gathered together in one place. What’s a question every R programmer asks at some point? Add it here! Grab questions from the r-faq tag to get them added ...
Berthold's user avatar
  • 101
Pinned
49 votes
5k views
2 minute read
How-to guide

How to write a good R question with a reproducible example

This article is largely written based on https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example When posting a question to Stack Overflow, you should include a minimal ...
user avatar

Can you answer these questions?

View all unanswered questions

These questions still don't have an answer

0 votes
0 answers
65 views

Why Does Trying to Load rJava Keep Resulting in an Error?

I am trying to run r5r for a transit network based analysis. I am using R 4.4.3 in Positron on Fedora 41. Some context for me is that I have a couple years of R underneath my belt, but I am absolutely ...
1 vote
0 answers
59 views

Recommended RStan compiler flags for gcc

I need to install RStan and I want to make sure that it's as efficient as possible. I'm using gcc. I'm reading this guide from 2022. Luckily, the Stan developers built an option called STAN_CPP_OPTIMS ...
0 votes
0 answers
60 views

R GEE Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels

I got this error when running GEE with unstructured correlation. Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more ...
2 votes
0 answers
67 views

Costing according to a schedule using the hesim package. All strategies at all times?

I am trying to produce a partitioned survival model (PSM) using the hesim package. When supplying a dataframe of costs to stateval_tbl(), which is then passed to create_StateVals(), it seems every ...
0 votes
0 answers
83 views

How can I adjust branches that are outside my phylogeny?

I am working on phylogenetic tree manipulation in R, and I'm encountering a visualization issue with one of my trees. A few branches are being drawn with lengths that go past the terminal nodes (tips) ...

Learn something new
These are the most recent articles in R Language Collective
49 votes
5k views
2 minute read
How-to guide

How to write a good R question with a reproducible example

This article is largely written based on https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example When posting a question to Stack Overflow, you should include a minimal ...
user avatar
20 votes
3k views
3 minute read
How-to guide

Create multiple PDF/HTML reports using R Markdown in a loop

How to create multiple PDF/HTML reports in a loop using R Markdown With R Markdown, creating a PDF or HTML report is straightforward. But what if you want to create various reports? Furthermore, what ...
Guibor Camargo Salamanca's user avatar