Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inhomogeneous behaviour using stby #160

Open
sariogonfer opened this issue Mar 31, 2022 · 1 comment
Open

Inhomogeneous behaviour using stby #160

sariogonfer opened this issue Mar 31, 2022 · 1 comment

Comments

@sariogonfer
Copy link

Hi,

I am trying to use the function stby with the func descr to be applied. If I test stby in a notebook importing the library:

library(summarytools)
stby(caso$FCR, caso$cluster, descr, stats = "common", transpose = FALSE, style = "rmarkdown") 

The output tables are aggregated

  1 2 3
Mean 2.61 2.51 2.72
Std.Dev 0.14 0.13 0.13
Min 2.30 2.23 2.36
Median 2.60 2.50 2.70
Max 2.95 2.84 3.02
N.Valid 69.00 59.00 72.00
Pct.Valid 100.00 100.00 100.00

But if I try with:

summarytools::stby(caso$FCR, caso$cluster, descr, stats = "common", transpose = FALSE, style = "rmarkdown") 

The output is:

FCR by cluster

Data Frame: caso
N: 69

  1 2 3
Mean 2.61 2.51 2.72
Std.Dev 0.14 0.13 0.13
Min 2.30 2.23 2.36
Median 2.60 2.50 2.70
Max 2.95 2.84 3.02
N.Valid 69.00 59.00 72.00
Pct.Valid 100.00 100.00 100.00

Descriptive Statistics

value

N: 69

  value
Mean 2.61
Std.Dev 0.14
Min 2.30
Median 2.60
Max 2.95
N.Valid 69.00
Pct.Valid 100.00

N: 59

  value
Mean 2.51
Std.Dev 0.13
Min 2.23
Median 2.50
Max 2.84
N.Valid 59.00
Pct.Valid 100.00

N: 72

  value
Mean 2.72
Std.Dev 0.13
Min 2.36
Median 2.70
Max 3.02
N.Valid 72.00
Pct.Valid 100.00

The problem is that whether I want to use this function in a shiny app, and get the firt style, it always returns the second one. What is the difference betweem each other? How can I obligate the function to return the aggregate style?

@dcomtois
Copy link
Owner

Hmmm that's a tricky one... I'm a bit confused about the output, could you provide a small reproducible example pls? Shiny experts are most welcome to chip in, too. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants