[R] weird error with contourplot
Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
Samuel.Cable at hanscom.af.mil
Thu Apr 16 16:12:28 CEST 2009
Call off the dogs. The problem was that because of the scale of my data
(<<1) contourplot somehow can't handle labeling the contours if it
"paints" the plot region as well. I can easily get around this by
re-scaling the data. But, if anyone can explain to me why throwing the
region=T flag makes a difference, I would be interested to know. Thanks
again!
--Sam
-----Original Message-----
From: Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
Sent: Thursday, April 16, 2009 9:55 AM
To: 'r-help at r-project.org'
Subject: weird error with contourplot
Sorry if I am cluttering up this list with too many rank beginner
questions. But I *am* a rank beginner, and I am at my wit's end with
this one:
I have a data frame df, with components x,y,z. This command to make a
contour plot with lattice graphics works just fine:
> contourplot(z~x*y,data=df,cuts=20)
Then I try
> contourplot(z~x*y,data=df,cuts=20,region=T)
And it dies on me with the error:
Error in unit(x, default.units) : 'x' and 'units' must have length > 0
I have done maybe a hundred contour plots in this same exact way, and
have never seen this error before. And it seems to me that adding the
flag region=T should be a benign thing to do. I have no idea what it
causing the problem. Anyone see what I'm doing wrong? Thanks!
--Sam Cable
More information about the R-help
mailing list