Pinned content
View all 3 collectionsR Language admins have deemed these posts noteworthy.
How to write a good R question with a reproducible example
R Language Frequently Asked Questions
Can you answer these questions?
View all unanswered questionsThese questions still don't have an answer
ggplot bar chart position = "identity" overlaying values with same number in wrong order
Colab Document R Session connecting to BigQuery Permissions
Optional Facet Argument for a Stacked Bar Chart in a Customized Function
Shared memory in parallel foreach in R using set.seed
Finding polygon coordinates from the locality name in R
Looking for an extra challenge?
View all bountied questionsThese questions have a bounty on them
Extract percentiles values from Scopus using R
How can I use a non-standard graphics device interactively?
Recommended answers
View all recommended answersThese answers have been recommended
Lag by n rows over specific columns while extending the lenght of dataframe
library(dplyr) rbind(df, df[0,][rep(NA, 2),]) %>% mutate(across(-2, ~lag(., 2))) %>% `rownames<-`(NULL) #> A B C D #> 1 NA 8 NA NA #> 2 NA 9 NA NA #> 3 1 10 15 22 ...
sort the gglikert chart based on the combination percentages in R
Here is one possible option which uses reorder and an ifelse to reorder the variable mapped on y using the counts (aka the sum) of Strictly disagree and disagree answers. Under the hood ggstats::...
Filtering multiple columns by date range, and calculating maximum value
Agree that longer format of data is preferable. Here is one approach using tidyverse. After pivoting data, converting dates, and filtering, you can use slice_max to get the highest viral load for each ...
R code for depression severity based on ICD-10 criteria
Instead of checking each possible condition you could use across() with rowSums() to determine the number of questions that fulfil the conditions regarding the minimum score or points. Then you can ...
Cross hatches with ggplot2
library(ggplot2) library(ggpattern) ggplot(peak.hillmeans1, aes(x = hill.number.type, y = hill.number.mean, fill = Subplot_Descriptions)) + ...
See what's trending
View all trending questionsThese are the most active questions in R Language Collective
How to make a great R reproducible example
Sort (order) data frame rows by multiple columns
How do I replace NA values with zeros in an R dataframe?
Drop data frame columns by name
How to join (merge) data frames (inner, outer, left, right)
How to write a good R question with a reproducible example
Create multiple PDF/HTML reports using R Markdown in a loop
Simply submit a proposal, get it approved, and publish it.
See how the process works