"hadley wickham" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, Jul 7, 2008 at 1:05 PM, Earl F. Glynn <[EMAIL PROTECTED]>
> wrote:
>> "hadley wickham" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
> Well, I do have fixup = FALSE, which the documentation indicates
> should return NA if the chroma exceeds the actual upper bound.
You did specify fixup in the hcl data.frame but I'm not sure how that info
was used when you called the hcl function since fixup is a parameter to the
hcl function.
Compare the two plots from below. When you get the NAs you want, the odd
colors go away, but I'm not sure you'll like the results:
# I dropped fixup from the data.frame (and used variable names that "Code
Complete 2" might approve):
hcl.grid <- expand.grid(hue = seq(0, 360, by = 2),
chroma = 70,
luminance = seq(0, 100, by= 2))
hcl.grid <- transform(hcl.grid,
angle = hue * pi / 180,
radius = luminance / 100
)
hcl.grid <- transform(hcl.grid,
x = radius * sin(angle),
y = radius * cos(angle)
)
# What you have
hcl.grid$colour1 <- hcl(hcl.grid$hue, hcl.grid$chroma, hcl.grid$luminance,
fixup=TRUE)
with(hcl.grid, plot(x, y, col=colour1, pch=20))
# What you intended?
hcl.grid$colour2 <- hcl(hcl.grid$hue, hcl.grid$chroma, hcl.grid$luminance,
fixup=FALSE)
with(hcl.grid, plot(x, y, col=colour2, pch=20))
efg
Earl F Glynn
Bioinformatics
Stowers Institute for Medical Research
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.