Hi All
I'm fairly new at R so there might be on obvious solution to my problem
with calling the lattice function xyplot( ) from my own function.
The function script is given below.
The problem is that the xyplot() call does not do anything! I just get a
blank graphics window and no error messages.
The simple plot() function call works fine when not commented out so I
know the data is getting in OK and when I run the the same xyplot()
function call outside this function substituting the actual data frame
then xyplot( ) works fine. Comparing the data summary both inside and
outside the function showed that the data is identical. I put the
"require('lattice')" statement in because I thought it might
help but it
did'nt.
Any help as to why xyplot() is behaving differently to plot() and what I
need to do to get the function working would be much appreciated.
thanks
Steve
------------------------------------------------------------------------
-----------
Steven G Candy
Applied Statistician
Australian Antarctic Division
203 Channel Highway, KINGSTON
Tasmania 7050
ph +61 3 6232 3135
"plot.fits.casal.trellis"<- function(data.df,xlim,ylim,XLAB,ylab) {
require('lattice')
frame( )
print(summary(data.df))
#plot(y=data.df$Mobs[data.df$year.f=="2004"],
x=data.df$Mage.r[data.df$year.f=="2004"],
# xlab = XLAB, ylab = ylab, ylim=ylim, xlim=xlim, type='p')
xyplot(data.df$Mobs+data.df$Mfit ~ data.df$Mage.r | data.df$year.f,
type=c("p","l"),pch=c("o","e"),cex=1.3,
xlab = XLAB, ylab = ylab, ylim=ylim, xlim=xlim)
}
___________________________________________________________________________
Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not
the
intended recipient, you are notified that use or dissemination of this
communication is
strictly prohibited by Commonwealth law. If you have received this transmission
in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209
and
DELETE the message.
Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________
[[alternative HTML version deleted]]