Description Usage Arguments Details See Also Examples
An alternative widget for editing a data frame using the RGtk2DfEdit package
1 2 3 |
items |
data frame to be edited |
name |
Name of data frame to save value to |
container |
An optional container to attach widget to |
... |
Can be used to overide default colors. |
toolkit |
Which GUI toolkit to use |
The gdf
widget is used for editing data frames, but does not
have the most natural keyboard handling. The RGtk2Extras package by
Tom Taverner provides a more powerful and easier to use interface for editing data
frame, and this wraps that widget into gWidgetsRGtk2.
The addHandlerColumnClicked
function can be used to add a
handler to the event when a column header is clicked. The component of
the first argument column.no
contains the column number.
This widget is a bit different from the others as it is not imported from gWidgets. As such, it won't exist until this gWidgetsRGtk2 package is loaded. In practical terms, you need to realize a widget before this one can be realized.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
w<-gwindow()
g<-ggroup(cont=w)
df<-gdfedit(iris, cont=g)
## check names
names(df)
names(df)[1]<-"new"
rownames(df)
colnames(df)
## check [
df[,]
df[1,]
df[,1]
## no [<- function
## check dim stuff
dim(df)
length(df)
## handler
addHandlerColumnClicked(df, handler<-function(h,...) {
print(h$column.no)
})
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.