This wasn’t documented anywhere (maybe it’s obvious?), but here is a short example using the included ‘bot’ dataset.
data(bot);
# Look at the existing factors, stored in bot@fac
a<-bot@fac;
# Add another arbitrary factor
a[2]<-a;
a[2]<-c(1:40);
names(a)[2]<-“number”;
# Put your new factors back into the object
a->bot@fac;
# Look at your data based on the new factor
panel(bot,cols=col.india(40)[bot@fac[,”number”]]);