[R] Help with vectors!

Dan D ddalthorp at usgs.gov
Wed Sep 9 20:57:25 CEST 2015


VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black")
c(factor(VAS)) # to give integer indexing to the colors

---
This is very nice, Frank. And it can be easily adjusted to match the
original criterion that the numbers match the order of appearance of the
colors in the original vector: 

c(factor(VAS,levels=unique(VAS)))




--
View this message in context: http://r.789695.n4.nabble.com/Help-with-vectors-tp4711801p4712061.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list