Shawn Way
2012-Aug-01 15:55 UTC
[R] Plotting cumsum data using lattice plots according to date conditioned by name.
I've been playing around with data like the following: Name Date Hrs Way, S 2-3-12 8 Nun, B 2-3-12 9 Way, S 2-4-12 7.5 Nun, B 2-4-12 9 Gus, T 2-5-12 8 I've been able to take this into a data.frame and even develop a cumsum for each of the people d.cum <- with(data,by(Hrs, INDICES=list(date=as.POSIXct(Name)),FUN=cumsum)) This gives me a list personnel with an array of cumulative hours, without any dates associated with the cumulative hours. What I've been trying to do is develop a conditioned lattice xyplot that allows the cumulative hours be plotted according vs date conditioned with the person's name. I've tried using something like this to try to create a data.frame for plotting, with only mild sucess. data.frame(date=as.POSIXct(Date[Name[2]]),hours=d.cum$`Way, S`,name=rep("Way, S",length(d.cum$`Way, S`))) and d.data <- as.data.frame(do.call("rbind",d.cum)) all to no avail. Can anyone point me in a good direction as to whatto look at next? Thank you kindly, -------------------------------------------------------------- Shawn Way, PE MECO, Inc. (p) 281-276-7612 (f) 281-313-0248 <img alt="" src="https://store.meco.com/awweb/img/meco_email.gif" /><br /> <a href="http://www.meco.com">WWW.MECO.COM</a><br /> This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. [[alternative HTML version deleted]]