function(                                                      # PLOT ACTIVITY/STATE OVER TIME FOR INDIVIDUAL UNITS
         df=factor(levels=dataframes(eN))[[1]]                  # Dataframe                      # data frame to plot
) {
  require(lattice)
  
  xn<-colnames(df)[2]
  sapply(df[,2],function(x)
    {
       check=unlist(strsplit(x[[1]],""))
       rel=x[[2]][check!="_"]
       mean(rel)
    }
  )->yspot
  print(xyplot(
      yspot~time,df,
      ylab="Strength",
#      scales=list(y=list(at= c() )),
      panel=function(x,y) {#yn=jitter(rep(1,dim(df)[1]),20);
      mapply(
        function(xo,yo)
        {
#          print(xo);
#          print(yo);
          xhold<-NULL; yhold<-NULL
          yi<-unlist(strsplit(yo[[1]],""))
          for(i in 1:length(yi))
          {
            jit=(i-.5-length(yi)/2)/4
            panel.text(xo+jit,yo[[2]][i],yi[i],cex=.4,col=(xo%%4)+1)
              xhold<-c(xhold,xo+jit); yhold<-c(yhold,yo[[2]][i]-.005);
            
          }
          panel.xyplot(xhold[yi!="_"],yhold[yi!="_"],type="l",col=(xo%%4)+1)
          panel.text(xhold[yi!="_"],yhold[yi!="_"]+.005,"_",col=(xo%%4)+1,cex=.4)
        }
        ,df[,1],df[,2]);
#        panel.text(x,yn,df[,2]);    
      panel.xyplot(x,y,type="l",col="grey"); 
      }
    )
  )
}
