I am constructing an RShiny app and am trying to generate the checkboxGroupInput options in an efficient manner.
I'd like to create a vector with every odd column name to avoid doing the below to generate the potential options for the user to select:
checkboxGroupInput("names","Names",c(colnames(df)[ncol(df)],colnames(df)[ncol(df)-2],colnames(df)[ncol(df)-4],etc...))
Is there a way to extract column names with a function like seq or letters? Ideally it would be something like, though of course the below does not work:
vector=c(colnames(Runs)[ncol(Runs)]:colnames(Runs)[3],-2)
Then I'd want to just insert that vector into the checkbox field.
Thanks for your help!