rwm-package {rwm} | R Documentation |
Utility functions for managing R workspaces and directories
Package: | rwm |
Type: | Package |
Version: | 1.35 |
Date: | 2010-01-06 |
License: | GLP >= 2 |
QUICK INSTRUCTIONS:
.UserDirectory
.
Optionally you may also with to define .UserDate
and the
startup function .First
.save.image()
.q()
.UserDirectory
This defines where you want to save your R workspaces. Here are some examples for different operating systems.
.UserDirectory <- "d:/r"
.UserDirectory <- "/Users/aim/R"
.UserDirectory <- "/home/faculty/aim/R"
.First
.First<-function() library(rwm)
.
You may also wish to attach to other R libraries as well, for example, if your editor is Winedt, you probably want to load RWinEdt.
SUMMARY
The main functions are loadws
, and savews
.
Additionally, cleanws
and cws
are provided.
These functions, where were
loosely inspired by APL commands: )LOAD
, )SAVE
, )CONTINUE
, and
and )CLEARWS
.
This package uses hidden global variables in the user's workspace:
.UserDirectory
, .UserDate
,
.WSID
, .LastSaved
and .Describe
.
When upgrading to a new version of 'rwm' you need to make that you are not
already attached to the package. Use the detach
function to detach the
library.
During installation you should ignore warnings about
no visible binding for global variables
.WSID
and .UserDirectory
since these are
assigned by the user after the package has been installed.
These settings are system and user dependent.
A.I. McLeod
McLeod, A.I. (2009). rwm: An R Package for Workspace Management
#INITIALIZATION #Normally .UserDirectory and .UserDate are defined previously. #Usually a more convenient directory is used but for illustration #using a script which will run in interactive or batch mode on any computer: .UserDirectory <- tempdir() .UserDate <- "2009" dir.create(paste(.UserDirectory, .UserDate, sep="/")) #Simple Example p<-3 n<-50 e<-rnorm(n) X<-matrix(rnorm(p*n), ncol=p) savews("MyWs") #The workspace MyWs contains the variables p, n, e, X