mycolors <- c('green','green','yellow','red','red','red','green')

# Create a factor object: 
myfactors <- factor(mycolors)
print("contents of the myfactors vector:") 
print(myfactors) 

print("the number of levels in myfactors:") 
print(nlevels(myfactors))

