Skip to content

Commit

Permalink
Load R session if .RData file is found in bioclipse-workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Georgiev committed Sep 16, 2011
1 parent a949d3b commit 9b01815
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -376,6 +376,7 @@ private void initSession() {
File file = new File(workspacePath.toString());
if (!file.exists())
file.mkdir();
//Load the bc2r package
eval("library(bc2r)");
// Java crashes when setting working directory with "\" in windows
eval("setwd(\""+file.getAbsolutePath().replace(fileseparator, "/")+"\")");
Expand All @@ -390,9 +391,10 @@ public boolean accept(File dir, String name) {
// Show R sessionfiles for user
String[] files = file.list(filter);
for(int i=0; i<files.length; i++){
status += NEWLINE + "Found R session: " + files[i];
status += NEWLINE + "Loaded R session: " + files[i];
eval("load(\"" + files[i] + "\")");
}
status += NEWLINE + "Use load(\"file\") and save.image(\"file\")";
status += NEWLINE + "Use load(\"file\") and save.image(\"file\") to manage your R sessions";
if (OS.startsWith("Mac")) // the default plotting device on Mac(Quartz) is not working good with StatET
eval("options(device='x11')");
}
Expand Down

0 comments on commit 9b01815

Please sign in to comment.