rwm-package {rwm}R Documentation

Workspace and Directory Management

Description

Utility functions for managing R workspaces and directories

Details

Package: rwm
Type: Package
Version: 1.35
Date: 2010-01-06
License: GLP >= 2

QUICK INSTRUCTIONS:

    Start
    Start R with blank workspace.
    Definitions
    Define the variable .UserDirectory. Optionally you may also with to define .UserDate and the startup function .First.
    Save
    Save the workspace with the command save.image().
    Quit
    Quit R, q()
    .

.UserDirectory

This defines where you want to save your R workspaces. Here are some examples for different operating systems.

    Windows:
    .UserDirectory <- "d:/r"
    Mac OS X
    .UserDirectory <- "/Users/aim/R"
    unix
    .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.

Upgrading

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.

Note

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.

Author(s)

A.I. McLeod

References

McLeod, A.I. (2009). rwm: An R Package for Workspace Management

Examples

#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


[Package rwm version 1.35 Index]