clearws {rwm}R Documentation

Clear workspace

Description

Removes all functions and datasets. Also removes .WSID but not .UserDirectory, .UserDate and other hidden variables. The working directory is reset to .UserDirectory.

Usage

clearws(silentQ=FALSE)

Arguments

silentQ FALSE, display message; TRUE, no message

Details

Using this function is similar to quitting R and starting R again with a fresh workspace except that the R command history is kept. All non-hidden R objects are deleted as well as the hidden variables .WSID, .LastSaved and .Describe if they exist in the current workspace.

Value

None

Author(s)

A.I. McLeod

See Also

loadws, savews,

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 <- "2008"
dir.create(paste(.UserDirectory, .UserDate, sep="/"))

#Fit model to airquality data, save and clear
NYO3.fit <- lm(Ozone~Solar.R + Wind + Temp, data=airquality)
NYO3.fit 
savews("NYO3")
clearws()
ls(all.names=TRUE)

[Package rwm version 1.35 Index]