I have created a checkBoxgroup of all the states in United States for my R shiny dashboard. I have a categorical column State in my database. Is there a way I can pass the entire column in choices as I want all the states in the column as choices in my checkbox. Currently, I am manually putting arguments like this :
checkboxGroupInput("checkGroup", label = h3("Checkbox group"),
choices = list("AL" ="AL",
"AR"="AR",
"AZ"="AZ",
"CO"="CO",
"CT"="CT",
"DC"="DC",
"DE"="DE",
"FL"="FL",
"GA"="GA",
"HI"="HI",
"IA"="IA",
"ID"="ID",
"IL"="IL",
"IN"="IN",
"KS"="KS",
"KY"="KY",
"LA"="LA",
"MA"="MA",
"MD"="MD",
.
.
.
.
))
I am looking for a better way to put these choices in the choices argument instead of manually typing each category.
Also when I put this in my UI function, This creates a big Checklist with all the states in one column which results in my app having more than one page. I want to fit it in the space I have maybe with multiple columns.
Attaching a screenshot below for reference as to how it looks right now :