[R-SIG-Mac]win.graph

David Strong david_strong@cox.net
Tue, 25 Feb 2003 10:52:45 -0500


Hello,

I am trying to adapt code for use in R 1.6 on a Mac in OS 10.2.  The 
program uses 'win.graph' to set plot size. What is the Mac equivalent? 
I have searched where I can but no luck. Any help would be appreciated.

Here is a snip of code where this is implemented.:

if (Gr.Avg)
	{
		if (Gr.Orient == 1)  win.graph(width=8.5, height=11)
			else  win.graph(width=11, height=8.5)
		par(mfrow=c(Gr.Rows, Gr.Cols), omi=c(.5,.5,.5,.5))

		X.Values <- Curves[[1]][,1]
		X.Range <- c(min(X.Values), max(X.Values))

		Y.Values <- rep(0,length(X.Values))
		for (i in 1:length(Curve.Info[,1]))
			Y.Values <- Y.Values + Curves[[i]][,2]
		Y.Values <- Y.Values / length(Curve.Info[,1])
		Y.Range <- c(min(Y.Values), max(Y.Values))

		P.Avg <- 1/((Y.Values[length(Y.Values)]/Y.Values[1]) + 1)
		if (P.Avg < 0) P.Avg <- 0  # correct for possibilities of negative 
values at extremes
		if (P.Avg > 1) P.Avg <- 1

		plot(X.Values, Y.Values, type = "p", pch = 16, ylim = Y.Range, xlim = 
X.Range,
		     ylab = "Mean Difference", xlab = "Input")
		lines(X.Values, Y.Values)  # solid line for raw data only
		mtext(paste("MAMBAC AVG CURVE, ",Data.Label),outer=T)
	}
	return(P.Avg)