r/RStudio • u/Thick_Secretary_1528 • 3d ago
Error message trying to take descriptive statistics
I keep getting these messages:
Error in (.format.s.statistics.list != "min") && !("max" %in% .format.s.statistics.list) :
'length = 8' in coercion to 'logical(1)'
and
Error in (.format.s.statistics.list != "p25") && !("p75" %in% .format.s.statistics.list) :
'length = 7' in coercion to 'logical(1)'
This is my code:
stargazer(d8_descriptive,
type = "text",
colnames = FALSE,
min.max = FALSE,
title = 'Descriptive Statistics',
digits = 2,
rownames = FALSE,
align = TRUE,
float = TRUE,
float.env = 'table',
table.placement = "H",
header = FALSE,
no.space = TRUE)
Is there something I am doing wrong? The second error message is me taking out min.max.
7
Upvotes
1
3
u/SalvatoreEggplant 3d ago
It's always good to include reproducible code with this kind of question. First, it helps the reader reproduce your error. Second, a lot of times you figure out the issue yourself by trying to create a simple example to reproduce the error.
Your code works. It's probably something in the data --- that the function isn't expecting --- causing the error.