I have looked at the two similar questions on this topic but do not find the answer I\'m looking for in either of the two. The as.table function alters the alphabetic sequence f
You need to specify the levels of that factor variable in the sequence you expect. The default is lexigraphic as you noticed:
xyplot(as.d$quant ~ as.d$sampdate | factor( as.d$site,
levels=1:length(unique(as.d$site))) ,
ylim=range(as.d$quant), xlim=range(as.d$sampdate),
main='Arsenic By Time', ylab='Concentration (mg/L)', xlab='Time')
Based on how the question currently stands, you might need:
require(gtools)
xyplot(as.d$quant ~ as.d$sampdate | factor( as.d$site,
levels=mixedsort( as.character(unique(as.d$site)) ) ) ,
ylim=range(as.d$quant), xlim=range(as.d$sampdate),
main='Arsenic By Time', ylab='Concentration (mg/L)', xlab='Time')