Skip to content
Prev 255572 / 398506 Next

Lattice wireframe or cloud plot with different colours by a group

On Apr 1, 2011, at 7:46 PM, David Winsemius wrote:

            
If you want to use grp as the color index then you need first to  
convert it to something that can be used as an index (with  
as.numeric), then use that in "[" to pull from a vector of colors:

cloud(flow~day*year,
       data=flow.dat,
       col=c("#FF3030", "#551A8B", "#43CD80")[
                        as.numeric(flow.dat$grp)],
       pch=20)