Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

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.3kQuestions
+70
13.9kMembers
+76
Contact
Contact
Stay up to date
We'll highlight new content in your collectives with a blue activity indicator on navigation items and posts.Manage preferences

Pinned Bulletins

View all 1 bulletins

R Language has some news to share

Bulletin
1 min read
2k views

Pinned content

View all 3 collections

R Language admins have deemed these posts noteworthy.

Pinned
49votes
4kviews
2 minute read

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-exampleWhen posting a question to Stack Overflow, you should include a minimal ...
user avatar
anon
Pinned
18votes
3kviews

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

0votes
0answers
44views

Using Precision-recall gain as the summary function in caret

Following on from Is there an R function to optimize the PRG AUC (area under the precision-recall-gain curve)?, I would like to use the area under the precision-recall-gain curve as the summary ...
0votes
0answers
38views

GTSUMMARY - Extract ARD & ARS json

I am generating a table with spanned header that requires tbl_merge. My code is as follows:# Load dataadvs <- pharmaverseadam::advs %>% filter(SAFFL == "Y" & VSTESTCD %in% c('...
0votes
0answers
18views

DESeq2 used with zinbwave weights - Differences on contrasts calculations

I have been using DESeq2 together with weights obtained from the zinbwave package for shotgun data analysis (as proposed here in the case of single-cell applications: https://genomebiology....
0votes
0answers
54views

Error: package or namespace load failed for 'caret' (conda environment with r-base = 4.4.3 and r-essentials)

Set-upconda version 24.7.1Created new environment in anaconda prompt:conda create --name r_env2 conda conda-forge::r-essentials conda-forge::r-base=4.4.3Confirmed that r-essentials included caret ...
0votes
0answers
100views

How to reduce compilation time for complex ggplot graphics

I have a graphic in ggplot that takes too long to compile. Actually, the plot does not appear and I have to force R to stop the compilation. As far as I know, the code has no error, but perhaps due to ...

Recommended answers

View all recommended answers

These answers have been recommended

0votes
1answer
31views

Get keyring passwords using dotenv to dynamically load main keyring password

I would like to load my keyring passwords via dotenv.library(keyring)library(dotenv)# Load environment variablesdotenv::load_dot_env()service_name <- Sys.getenv("KEYRING_SERVICE")...
Answer

You're missing keyring= in your call to keyring::key_set_with_value(). When I set that, it should no longer prompt for the system/default keyring.My .env file:KEYRING_SERVICE="quux"...

View answer
r2evans's user avatar
1vote
2answers
90views

String pattern to extract street number and name

I have a data frame with a column of street addresses, some of which include suite, apartment, floor, etc., which are not useful in retrieving the latitude and longitude of the address.I have ...
Answer

This looks like an XY-problem.You don't need to deal with those "unwanted" portions.data.frame( id = 1:5, full_address = c( "1600 Pennsylvania Ave NW, Washington, DC 20500, ...

View answer
M--'s user avatar
  • 31.4k
2votes
2answers
74views

Customize Annotation in a ggplot2 with dynamic content and italics and supersripts [duplicate]

I'm looking to create a plot in R that dynamically retrieves and displays the results of a statistical test as an annotated text directly on the plot. I want to achieve precise formatting for the ...
Answer

You can use ggtext and html/markdown:myplot <- ggplot(df, aes(x=factor(resp), fill=resp))+ geom_bar(stat="count", width = 0.5) + ylab("N of occurences")+ ...

View answer
r2evans's user avatar
1vote
1answer
70views

How to tell mapshot not to crop leaflet or mapview maps

I recently noticed that every time I saved a leaflet map to file as PNG or PDF, my saved map boundaries are narrower than what my shiny app mainPanel is showing. I looked into the mapshot() arguments ...
Answer Accepted

mapshot captures the default viewport which does not necessarily match your app's actual container dimensions.Here, I am capturing dimensions of the leaflet container (both initially and on resize). ...

View answer
M--'s user avatar
  • 31.4k
3votes
1answer
73views

modelsummary with `shape="cbind"`: put coefficients of different models in the same column [closed]

Consider the following example:library(palmerpenguins)library(modelsummary)library(marginaleffects)library(tidyverse)mydf <- palmerpenguins::penguinsmydf <- mydf %>% filter(species ...
Answer Accepted

Simply use rbind when creating the list of your models:modelsummary::modelsummary( list( "base" = rbind(res1, res2), "ctrl" = rbind(res3, res4) ), stars = TRUE)

View answer
M--'s user avatar
  • 31.4k

See what's trending

View all trending questions

These are the most active questions in R Language Collective

2464votes
23answers
485kviews

How to make a great R reproducible example

When discussing performance with colleagues, teaching, sending a bug report or searching for guidance on mailing lists and here on Stack Overflow, a reproducible example is often asked and always ...
1511votes
21answers
1.4mviews

Sort (order) data frame rows by multiple columns

I want to sort a data frame by multiple columns. For example, with the data frame below I would like to sort by column 'z' (descending) then by column 'b' (ascending):dd <- data.frame(b = factor(c(...
991votes
30answers
2.2mviews

How do I replace NA values with zeros in an R dataframe?

I have a data frame and some columns have NA values.How do I replace these NA values with zeroes?
1052votes
25answers
2.0mviews

Drop data frame columns by name

I have a number of columns that I would like to remove from a data frame. I know that we can delete them individually using something like:df$x <- NULLBut I was hoping to do this with fewer ...
1570votes
14answers
1.9mviews

How to join (merge) data frames (inner, outer, left, right)

Given two data frames:df1 = data.frame(CustomerId = c(1:6), Product = c(rep("Toaster", 3), rep("Radio", 3)))df2 = data.frame(CustomerId = c(2, 4, 6), State = c(rep("Alabama&...

Learn something new
These are the most recent articles in R Language Collective
49votes
4kviews
2 minute read

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-exampleWhen posting a question to Stack Overflow, you should include a minimal ...
user avatar
anon
20votes
3kviews
3 minute read

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

How to create multiple PDF/HTML reports in a loop using R MarkdownWith 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
Collectives on Stack Overflow: a subcommunity defined by tags to help you find trusted answers faster and share knowledge with the community.
Get started with collectives
AVERAGE RESPONSE RATE(within 24 hours)
66%
Help improve the percentage byAnswering questions
LEADERBOARD POSITION
the collective and see where you rank to compete
Top tags
 × 510983 questions
 × 57660 questions
 × 37640 questions
 × 29473 questions
 × 13829 questions
Members can contribute articles
Simply submit a proposal, get it approved, and publish it.
See how the process works

[8]ページ先頭

©2009-2025 Movatter.jp