I am trying to combine a a couple of rows into a dataframe. So below is the code I am using to get the output dataframe.
myData <- reactive({
age_selected <- input$selected_age
gender_selected <- input$selected_gender
ethnicity_selected <- input$selected_ethnicity
df <- with_demo_vars %>%
filter(age == age_selected) %>%
filter(gender == gender_selected) %>%
filter(ethnicity == ethnicity_selected) %>%
pct_ever_user(type = "SM")
#df[, c("variable", "sum_wts", "se")]
#interval=paste(df$ci_l,df$ci_u,collapse = "-")
df <- mutate(df, intervals= paste("(",round(ci_l,digits = 3), round(ci_u,digits = 3),sep = "-",")"))
# %>% c("variable", paste("mean",x), "sum_wts", "se")
#df[c(("variable", "mean", "sum_wts", "se","x")]
})
The output what I get and what I want are as following:
Thank You.