使用gdf更改数据框后,如何检索我创建的数据框?
示例代码:
require("gWidgets2RGtk2")
## Sample Data frame
x<-data.frame(a=c(1,2,3),b=c(4,5,6))
## Create Widget
w<-gwindow("gdf")
a<-gdf(x,cont=w)
## Makes some changes using widget
svalue(a)
> NULL
答案 0 :(得分:0)
管理以找出解决方案,虽然它似乎不合逻辑!
a #Doesn't work
# Object of class GDf
a[1:nrow(a),1:ncol(a)] # Works
# a b
# 1 1 4
# 2 2 5
# 3 3 6
# NA NA
str(a[1:nrow(a),1:ncol(a)]) #Shows that this is a data frame
# 'data.frame': 4 obs. of 2 variables:
# $ a: num 1 2 3 NA
# $ b: num 4 5 6 NA
答案 1 :(得分:0)