510,935 questions
-1
votes
0
answers
27
views
R: Finding out between which dates a certain action occurs
I am working with the R programming language.
I have this dataset:
library(dplyr)
library(tidyr)
library(lubridate)
combined <- structure(list(country = c("Canada", "France", &...
0
votes
0
answers
17
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
38
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(
&...
0
votes
0
answers
24
views
Handle outliers in clustering [closed]
I’m working on a cluster analysis of Italian provinces based on three fire-related indicators: total burned area (ha), burned area per fire, fire density.
Because these variables are measured on ...
5
votes
2
answers
90
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)
I happened to come across the following problem.
Consider the global assignment statement:
xxx <<- c(1,2)
xxx[1:2]
ls()
This gives
[1] 1 2
[1] "xxx"
...
2
votes
1
answer
43
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
41
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
44
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
72
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
46
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
65
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(), ...
0
votes
1
answer
48
views
if statement to check for the presence for a dplyr column name [closed]
I have written the following function where when I pass the argument color_col the plot should color each of the traces with a seperate color. In this instance its the weekend column which has 3 ...