I am very much new to the R GUI programming. I wanted the user to dynamically select columns in the dataframe and then after that dynamically select the levels of the selected columns.
My intent is to allow users to select columns and the filter values and then get the dataframe filtered upon those. For getting the column names, I am getting correct values. However, while fetching the levels of the selected column, the for loop exits and the selected values are not getting captured in the cba and cbv variable.
items<-colnames(joined_final)
items<-levels(joined_final$State)
cbg<-gcheckboxgroup(items,cont=TRUE,use.table = TRUE, index=TRUE,container = w)
cb<-svalue(cbg,index=TRUE)
j<-length(cb)
func(joined_final,j,cb)
func<-function(joined_final,j,cb){
cbv=c()
for (i in seq(j)){
items_1<-levels(joined_final[,cb[i]])
cba<-gcheckboxgroup(items_1,cont=TRUE,use.table = TRUE, container = w)
cbv<-svalue(cba)
}
return(cbv)
}
Please help me with this. Thanks in advance