Skip to main content
The 2024 Developer Survey results are live! See the results

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.8k Questions
+289
10.8k Members
+63
Contact

Pinned content

View all 3 collections

R Language admins have deemed these posts noteworthy.

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
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

Can you answer these questions?

View all unanswered questions

These questions still don't have an answer

0 votes
0 answers
11 views

Error using mcp2atm function for robust pairwise comparisons - undefined columns selected

I used a robust two-way ANOVA using the WRS2 package (R v.4.4.1), using the following code as suggested by Mair and Wilcox (2020) - the full dataset is on the bottom of this message: library(WRS2) ...
0 votes
0 answers
8 views

How to get predicted probabilities of being in each class of three using xgboost in R?

I am trying to train a xgboost model using iris dataset. The training code is shown below, and both prediction functions produce the same results. However, the length of the results is 135, while ...
0 votes
0 answers
10 views

Predicted values in a Tweedie GLM-model

I need help with how to create an actual vs predicted plot for a Tweedie GLM model in R where weights are used. I have a Tweedie GLM model in R where I have derived the coefficients/factors for a risk ...
0 votes
0 answers
18 views

How to speed up R dist matrix for hierarchical clustering for large matrix input data?

I have a large matrix (approximately 35,000 x 35,000) and I'm preparing a distance object in R for hierarchical clustering. The base R function dist() is too slow, so I'm using the distances function ...
0 votes
0 answers
6 views

I want to colorize the points of a Shapviz dependence output acording to the variable

I have been trying to change the colors of the points on each variable, but even though i've tried using scale_x_discrete, by and changing the colors, or using scale_color_manual(), nothing works for ...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

4 votes
0 answers
91 views
+100

When extending ggplot2, how should I apply scaling functions per group instead of as a whole?

I'm working on a new geom for ggplot2 that allows the user to alter the tint and shade of the colors by mapping it to an aesthetic. (If someone knows of a place this has already been implemented, ...
1 vote
0 answers
76 views
+50

Issues connecting odbc in newest R Studio update

I recently updated R Studio and odbc/dbi seems to be broken. Running packageVersion("odbc") I see: [1] ‘1.5.0’ Warning message: package ‘odbc’ was built under R version 4.4.1 My current ...
1 vote
1 answer
666 views
+50

lintr no visible binding for global variable ‘.SD’

lintr throws error while using data.table functions like .SD, .SDcols, e.g: /path/readData.R:130:29: warning: no visible binding for global variable ‘.SD’, Did you mean 'SSD'? DT[, "row.sum" := ...

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