Dear S-plus Experts (particularly graphics experts);
Here's a puzzler. The code below produces some model comparison time series
plots for which the data are on different scales, and cover different time
periods. The code makes beautiful plots with lots of little details to make
the whole chart set look nice in a report. The browser stops after each plot
which allows me to send pages with multiple plots to the printer once the page
is full, (actually the browser is convenient for other reasons too.) The
trouble is, when the program has finished generating all of the plots, it
disappears. Using fix() or fix()ing the object directly produces
"expression()". Why is my code vanishing?
-Sean Keenan
function(M, nms)
{
#Function Name: EW.tsplot.prg.
#Creates Model Comparison Time Series Plots by Obligor.
#M contains the model outputs and integer dates.
#nms contains company names and cusips.
#Last Edited 9/19/00.
#
#First Set up Dummies, Temp Vbls, etc.
len <- dim(nms)[1]
time <- rts(seq(1:63), start = 1995.4, freq = 12)
par(oma = c(3, 0, 0, 3)) #
#Process Data by CUSIP.
for(i in 1:len) {
cus <- nms$cusip[i]
nam <- as.matrix(nms$coname[i])
Z <- M[M$cusip == cus, ]
obs <- dim(Z)[1]
if(obs > 15) {
Z <- Z[order(Z$NUMDAT), ]
ddate <- min(Z$NUMDAT[Z$DEFS == 1])
tsplot(Z$EDP, Z$EDF, xaxt = "n", ylim = c(0, 20), lty = c(3, 4), cex = 0.7)
title(paste(nam), cex = 0.7)
mtext("EDF/EDP", side = 2, line = 2, cex = 0.6)
abline(v = ddate)
text(ddate, 21.75, "t-12", cex = 0.65) #
#Turn EW Into Time Series and Overlay Plot.
begin <- min(Z$NUMDAT)
this.time <- time[begin:63]
st <- tspar(this.time)[1]
pred.ts <- rts(Z$pred, start = st, freq = 12)
par(new = T)
ts.plot(pred.ts, ylim = c(-3.6, 1), yaxt = "n", xlab = "Months")
axis(side = 4)
mtext("EW Score", side = 4, line = 2, cex = 0.6)
}
browser()
}
}
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|