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

survey_median will break if there is no group and no variable names in the summarise function (as opposed other survey_*) #183

Open
yannsay-impact opened this issue Nov 28, 2024 · 0 comments

Comments

@yannsay-impact
Copy link

I am not sure if it is a bug per se.

library(srvyr)
repex_df <- data.frame(group = c(rep("a", 5), rep("b",3)),
                       variable_x = c(runif(5), rep(NA, 3)))

data_survey_design <- srvyr::as_survey(repex_df)
data_survey_design |>
  summarise(survey_median(variable_x, na.rm = T))

image

data_survey_design |>
  summarise(survey_mean(variable_x, na.rm = T)) 

image

data_survey_design |>
  summarise(stat = survey_median(variable_x, na.rm = T)) 

image

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

No branches or pull requests

1 participant