user interface - "Add" Button for Data Frame Editing GUI in R -


i'm trying create gui in r user can add, edit, or search entries within data frame. adding new entry created "add" button opens new window. code follows:

add     <- gbutton("add entry",                 handler = function(h,...){                 input <- gwindow("input new entry")                 vals  <- ggroup(horizontal = f, use.scrollwindow = t, container = input)                 cols  <- 1:length(colnames(data))                 text  <- vector()                 (n in cols) {                   adds    <- gedit(initial.msg = colnames(data)[n], container = vals)                   text[n] <- adds[]                 }                 save  <- gbutton("add entry",horizontal = f,                            handler = function(h,...){                             tab[dim[1]+1,] <- text                             dim[1] = dim[1] + 1                             dispose(input)                           },                                  container = vals)                 },                 container = bttns) 

for reference data original data frame used, dim vector dimensions of data frame, bttns group in add button appears in original window, , tab data frame table added in original window gdf.

my goal create gedit each column entry in data , append new entry last row in original data frame. creating each gedit manually seems defeat purpose of computer programming. there way can save vector of widgets? preceding code doesn't give errors, doesn't save data after entered new window. there easier way other using loop? appreciated!


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -