510,935 questions
0
votes
1
answer
23
views
RStudio filter function declaring the wrong type of an object
I am going through an RStudio tutorial about the Pearson & Spearman Correlation Matrices in R, available here. The first sample code, to be used in RStudio, reads a .csv file (available here) and ...
1
vote
0
answers
26
views
set ggpattern output to desired motif
I'm working with the following dataset and wish to produce a ggpattern bar plot. I will attach a drawing of what would be my desired output since it might be too complex/wordy to explain.
rpe1_h9 <-...
-2
votes
1
answer
70
views
Finding out between which dates a certain action occurs
I have this dataset:
library(dplyr)
library(tidyr)
library(lubridate)
combined <- structure(list(country = c("Canada", "France", "Japan", "Brazil",
"...
0
votes
0
answers
26
views
Cannot link R function on Win10 to .bin executable on WSL/Debian
I attempted to execute code entitled "Multilayer community detection" using the muxViz library (https://github.com/manlius/muxViz) published on https://manlius.github.io/muxViz/articles/...
0
votes
0
answers
47
views
Error bars not aligned to vertical gridlines
This is the code:
library(ggplot2)
mortality_incidence_data <- read.csv("Report Data Death.csv")
mortality_incidence_data$year <-
factor(mortality_incidence_data$year,levels = c(
&...
5
votes
2
answers
115
views
Why is it not possible to replace part of a global vector in this example?
R version 4.5.0 (2025-04-11 ucrt)
RGui console in Windows 11.
I happened to come across the following problem.
Consider the global assignment statement:
xxx <<- c(1,2)
xxx[1:2]
ls()
This gives
[...
2
votes
1
answer
49
views
Using marginaleffects inside a purrr::map
I use the tidyverse suite to estimate 6 linear models as a function of empirical subgroups and different functional forms
library(tidyverse)
library(magrittr)
library(marginaleffects)
library(...
Advice
0
votes
3
replies
40
views
How to handle heteroskedasticity when detecting anomalies using Z-scores on growth rates?
I’m trying to detect anomalies in a dataset using Z-scores based on the logged index change of a value between two time periods: VAL_t0 and VAL_t1.
The issue:
The variance of Z-scores decreases as ...
0
votes
0
answers
42
views
Does the 'value ~ group*time + Error(id /time)' model (=within-between ANOVA) take baseline value differences into account? [closed]
I have patients divided into two groups: treatment and placebo. Each subject is measured at two time points: before and after. I am performing an ANOVA using the afex::aov_car() function with the ...
0
votes
1
answer
48
views
How to add space between \tabular columns in R roxygen2 documentation?
In my R package roxygen2 documentation with markdown enabled (I have Roxygen: list(markdown = TRUE) in my DESCRIPTION file), I have the following code:
#' \tabular{ll}{
#' \code{~.} \tab ...
-1
votes
0
answers
32
views
R vs SAS vs JMP: Fitting and Comparing GLMM's [closed]
All three of the software uses one of two estimating methods by default:
Maximum Likelihood Estimation: R
Pseudo-Likelihood Estimation: JMP and SAS
SAS can be specified to fit with Maximum ...
Advice
1
vote
4
replies
74
views
Integer arithmetic in R, allowing integer overflow
By default, when a result of integer operation would not fit into R's 32bit integer type, we get a warning and the result is NA. E.g.:
1920912463L
# 1920912463 (valid integer)
1920912463L + ...
-1
votes
1
answer
48
views
R ggplot: force legend guide of separate geoms onto separate rows when using horizontal legend [duplicate]
I am creating a chart with two different geoms and would like to include them on separate rows (one row per geom) in a legend at the top of the chart. For example:
ggplot(data = iris) +
geom_point(...
0
votes
0
answers
52
views
ERGM and edgecov() with missing data [closed]
I am using the ergm package and I want to have an edgecov() variable which has missing data.
I am doing network analysis of a unit with 48 people. However, I only have a response rate of 74%. This ...
2
votes
1
answer
67
views
Is it possible to dispatch on a "name" object?
I have an object that could be either a "name" or a "call", and I want it to end up as a "call". By a "name" object, I mean like something created by bquote(), ...