Hi all,
I'd like to do a scatterplot where some of the values, out of a subset,
are plotted differently in color and shape.
I've worked around the following code but I don't manage to make it right.
Any help greatly appreciated!
# My data
dd <- iris
iris$Code <- 1:150
# A selection of my data I'd like to plot differently
subset <- subset(iris, iris$Sepal.Width<5)
sel <- as.character(subset$Code) # I think the problems start already
here :)
# Plotting doesn't work
plot(iris$Sepal.Length ~ iris$Sepal.Widith,
col=ifelse(iris$Code==sel, "red", "black")
pch=ifelse(iris$Code==sel, 17, 1))
______________________________________________
R-help@r-project.org 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.