Hello everyone. This is probably a very easy problem, however I wasn't
able to find any solution in the documentation and examples of gWidgets.
I want to open a file selection dialog (gfile()) and if the user selects
an .Rdata file, it should be loaded. So I wrote the following function
that is executed when someone clicks an "load RData file" button:
fOpen= function(h,...) {
filepath <- as.character(gfile(filter = list("R files" = list(patterns
= c("*.Rdata")))))
load(file=filepath)
}
"filepath" is the correct path to the RData file that should be loaded.
However, the file does not get loaded into the workspace. What elementary
thing am I missing here?
Thank you very much for your help in advance,
Bernhard
[R-gui] loading an RData File using gWidgets
2 messages · bernhard at jabberoo.net, Wayne.W.Jones at shell.com
I dont have any experience with Gwidgets. However, one alternative would be to use tcltk. See http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/FileOpenSave.html for an example. This has worked fine for me. Regards Wayne -----Original Message----- From: r-sig-gui-bounces at stat.math.ethz.ch [mailto:r-sig-gui-bounces at stat.math.ethz.ch]On Behalf Of bernhard at jabberoo.net Sent: 21 May 2008 07:22 To: r-sig-gui at stat.math.ethz.ch Subject: [R-gui] loading an RData File using gWidgets Hello everyone. This is probably a very easy problem, however I wasn't able to find any solution in the documentation and examples of gWidgets. I want to open a file selection dialog (gfile()) and if the user selects an .Rdata file, it should be loaded. So I wrote the following function that is executed when someone clicks an "load RData file" button: fOpen= function(h,...) { filepath <- as.character(gfile(filter = list("R files" = list(patterns = c("*.Rdata"))))) load(file=filepath) } "filepath" is the correct path to the RData file that should be loaded. However, the file does not get loaded into the workspace. What elementary thing am I missing here? Thank you very much for your help in advance, Bernhard _______________________________________________ R-SIG-GUI mailing list R-SIG-GUI at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-gui