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.
513.4k Questions
+288
10.6k Members
+74
Contact

Pinned content

View all 3 collections

R Language admins have deemed these posts noteworthy.

Pinned
41 votes
3k 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
Pinned
17 votes
2k 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

Can you answer these questions?

View all unanswered questions

These questions still don't have an answer

0 votes
0 answers
10 views

Extracting matched data using overlap weights

I have generated overlap weights on R using weightit package, I generally fo regression using weights directly. But I want to extract the matched data according to overlap weights for demographic ...
0 votes
0 answers
5 views

clmm function gives me an error "Error in x$code == 0L || action == "silent" : Error 'length = 2' in coercion to 'logical(1)'"

The following commands regarding the two types of models are executed in R model_4_clmm <- clmm(v27_3 ~ SEX_2 + AGE + PARTLIV_2 + EDULEVEL_2 + WORK_2 + ISCO08_2 + PARTY_LR_2 + v4_3 + gdp_per_capita....
0 votes
0 answers
16 views

Convert ordinal word string to ordinal number string?

Suppose I have a vector containing ordinal number words as strings in R: ordinal_words<-c("FIRST COMPANY", "BAKERY FIFTH AVENUE", "WEST FORTIETH WAY") I would like ...
0 votes
0 answers
20 views

How do I order a barchart, but not by ascending or descending order?

I am making a bar chart breaking down time spent at each activity level(high, medium, low, and total active times) for individuals recorded to be in different fitness levels. here is the code I am ...
0 votes
0 answers
12 views

NA values when using avg_predictions() from marginaleffects with a flexsurv model

I'm unsure why I do not get standard errors or confidence intervals when I fit parametric survival models and compute the predicted mean survival times using the avg_predictions(). I tried using ...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

1 vote
1 answer
74 views
+100

Create dropdown list in R using plotly?

I want to create a dropdown list with the years 2019 to 2024 for this plot: I'm using R Markdown and plotly to create the interactive plot. I managed to make this plot for 2021, but I can't seem to ...
1 vote
1 answer
101 views
+50

Using LaTeX packages in Quarto YAML for Typst output-formats

I want to use LaTeX packages in the Quarto YAML header for Typst output formats. A sketch of my YAML header is below. It seems that it doesn't work for \usepackage[none]{hyphenat}. The output shows ...

Learn something new
These are the most recent articles in R Language Collective
41 votes
3k 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
19 votes
2k 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