Pinned content
View all 3 collectionsR Language admins have deemed these posts noteworthy.
R Language Frequently Asked Questions
How to write a good R question with a reproducible example
Can you answer these questions?
View all unanswered questionsThese questions still don't have an answer
Trouble with fitting confirmatory factor models in R with lavaan
Add red shade/area to facet plot
Differences in results between terra::extract and exactextractr::exact_extract
How to obtain and export a panelAR regression result?
Piecewise SEM pathway plotting
Recommended answers
View all recommended answersThese answers have been recommended
How to include plain text or markdown prose inside a reprex?
To include plain text or markdown prose between your code blocks in a {reprex}, you need to use Roxygen style comments starting with #'. The {reprex} package uses knitr::spin() under the hood. Any ...
Dropping unused y values when using scale_x_datetime(limits =)
The core issue is that scale_x_date(limits=) filters data before y range training, but the y scale is still trained on the full dataset. coord_cartesian(xlim=) zooms but doesn't retrain the y scale ...
Checking whether external pointer of a data.table is valid
If you want to check if the reference is valid, the data.table package has a .selfref.ok() function data.table::.selfref.ok(tmp3) # [1] FALSE data.table::.selfref.ok(tmp2) # [1] TRUE data.table::....
move legend in empty facet
Following and updating my comment, you can use lemon::reposition_legend() to bring the legend into one of the facets. Up front, though, we can't use facet_wrap2() since that doesn't label the empty ...
What's the difference between the left curly brace and the right curly brace?
Yes, you're right. In R, operators are actually functions that can be called with backtick notation and we can be aliasing to readable names first: parenthesis = `(` assignment = `<-` plus = `+` ...
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