Dear John,
Actually, I was using gWidgetsRGtk2.
The solution you suggest works fine.
Thank you very much.
Best regards. Olivier
--
____________________________________
Olivier G. Nuñez
Email: onunez en iberstat.es
Tel : +34 663 03 69 09
Web: http://www.iberstat.es
____________________________________
El 27/05/2009, a las 17:28, John Verzani escribió:
> Dear Olivier,
>
> I don't have any such methods. If you really want this, you can do
> it from RGtk2 (assuming you are using gWidgetsRGtk2 -- if you are
> using gWidgetstcltk let me know and I'll find something similar) as
> follows:
>
> library(gWidgets)
> library(RGtk2) ## load in RGtk2 methods
> options(guiToolkit="RGtk2")
>
> t <- gtable(mtcars[1:5, 1:4], cont = gwindow())
>
> removeColumn <- function(t, col.num) {
> name <- names(t)[col.num]
> tbl <- getToolkitWidget(t)
> ## remove a column, but store old one first to add back
> col <- tbl$getColumn(col.num - 1) # 0- based
> tbl$removeColumn(col)
> return(list(name=name, col=col))
> }
>
> addColumn <- function(t, col, col.num) {
> tbl <- getToolkitWidget(t)
> ## add back
> tbl$insertColumn(col$col, col.num - 1)
> ## add back column name
> col$col$getWidget()$getParent()$getParent()$getParent()$setLabel(col
> $name)
> }
>
> ## check if it works
> col = removeColumn(t, 1)
> addColumn(t, col, 1)
>
> Hope that helps.
>
> --John
>
> On Wed, May 27, 2009 at 6:05 AM, Olivier Nuñez <onunez en
iberstat.es>
> wrote:
> Dear John Verzani,
>
> I would like to know if there exists a simple way to make invisible
> some columns of a gtable object (say T).
> The solution I use until now, consists in removing T and then
> creating a new T with the desired columns.
> But, It is not really efficient especially because the creation of
> a gtable object is time expensive.
> Best regards. Olivier
>
> -- ____________________________________
>
> Olivier G. Nuñez
> Email: onunez en iberstat.es
> Tel : +34 663 03 69 09
> Web: http://www.iberstat.es
>
> ____________________________________
>
>
>
>
>
>
>
> --
> John Verzani
> Chair, Department of Mathematics
> College of Staten Island, CUNY
> verzani en math.csi.cuny.edu